/* ==========================================================================
   PIYUSH PORTFOLIO - ULTRA-CLEAN MODERN DEVELOPER DESIGN SYSTEM
   Theme: Executive Obsidian, Royal Indigo, Elegant Glassmorphism
   No Cyber/Hacker tropes, No CRT scanlines, 100% Professional & Responsive
   ========================================================================== */

:root {
  /* Slate & Obsidian Palette */
  --bg-main: #090d16;
  --bg-surface: #0f172a;
  --bg-card: rgba(19, 27, 46, 0.7);
  --bg-card-hover: rgba(28, 38, 64, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.8);
  
  /* Modern Luxury Accents */
  --accent-primary: #6366f1;       /* Indigo */
  --accent-secondary: #8b5cf6;     /* Violet */
  --accent-light: #a78bfa;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-blue: #38bdf8;          /* Sky Blue */
  --accent-emerald: #10b981;       /* Emerald */
  
  /* Text */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  /* Borders & Glass */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  --glass-blur: blur(20px);
  
  /* Typography */
  --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Dimensions */
  --mini-player-height: 76px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-pill: 9999px;

  /* Transitions */
  --tr-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  padding-bottom: calc(var(--mini-player-height) + 24px);
}

/* Subtle Ambient Gradient Background (No Harsh Grids / No Scanlines) */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.2;
}

.orb-top-left {
  top: -120px;
  left: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.orb-bottom-right {
  bottom: -150px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
}

.orb-center {
  top: 40%;
  left: 35%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
  opacity: 0.12;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Typography Helpers */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 20%, var(--accent-light) 65%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-accent {
  color: var(--accent-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--tr-fast);
  border: 1px solid transparent;
}

.btn-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #7073f4 0%, #9b6bf7 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-main);
  backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.btn-pill {
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: all var(--tr-fast);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 0 12px var(--accent-glow);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--tr-fast);
  cursor: pointer;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all var(--tr-fast);
}

.mobile-drawer {
  position: fixed;
  top: 65px;
  left: 0;
  width: 100%;
  background: rgba(9, 13, 22, 0.98);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transform: translateY(-120%);
  opacity: 0;
  visibility: hidden;
  transition: all var(--tr-smooth);
  z-index: 99;
}

.mobile-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.mobile-nav-link.active, .mobile-nav-link:hover {
  color: #ffffff;
}

/* ==========================================================================
   Hero Profile Section
   ========================================================================== */
.hero {
  padding: 3.5rem 0 2rem 0;
}

.hero-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.hero-cover {
  width: 100%;
  height: 220px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 60%, #172554 100%);
}

.hero-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.hero-body {
  padding: 0 2.5rem 2.2rem 2.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -65px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.avatar-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-main);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  background: #1e1b4b;
}

.status-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: var(--accent-emerald);
  border: 3px solid var(--bg-main);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
}

.hero-info {
  flex: 1;
  min-width: 280px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 0.6rem;
}

.profile-title {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.profile-tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  max-width: 640px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Metrics Row
   ========================================================================== */
.metrics-section {
  padding: 1.5rem 0 3rem 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--tr-fast), border-color var(--tr-fast);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.metric-num {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.metric-lbl {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Section Layouts & Clean Cards
   ========================================================================== */
.section-block {
  padding: 3rem 0;
  display: none;
}

.section-block.active {
  display: block;
}

.section-head {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: transform var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.8rem;
}

/* ==========================================================================
   Skills Grid
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.4rem;
}

.skill-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.skill-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.skill-pct {
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.95rem;
}

.skill-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-blue));
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

/* ==========================================================================
   Projects Grid
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--tr-smooth), border-color var(--tr-fast);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.project-thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.2rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.project-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--accent-light);
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Gallery Grid & Clean Lightbox
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  height: 220px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--tr-smooth);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption-overlay {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  background: linear-gradient(to top, rgba(9, 13, 22, 0.9) 0%, transparent 100%);
  padding: 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.lightbox-modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(5, 8, 15, 0.95);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
}

/* ==========================================================================
   Social Links Grid
   ========================================================================== */
.socials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.social-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--tr-fast);
}

.social-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.social-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-light);
  flex-shrink: 0;
}

/* ==========================================================================
   Universal Bottom Music Player (Clean Spotify / Apple Music Style)
   ========================================================================== */
.mini-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mini-player-height);
  background: rgba(11, 16, 28, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 95;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
}

.mini-track-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 220px;
  max-width: 320px;
}

.mini-album-art {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.mini-album-art.spinning {
  animation: spin 10s linear infinite;
  border-radius: 50%;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mini-track-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-track-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mini-player-controls {
  flex: 1;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin: 0 1.5rem;
}

.mini-buttons-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.player-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr-fast);
}

.player-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.player-btn.play-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #090d16;
}

.player-btn.play-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

.mini-scrub-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.time-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 30px;
}

.scrub-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.scrub-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

.mini-extra-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 200px;
  justify-content: flex-end;
}

.volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: rgba(9, 13, 22, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem 0;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: #fff;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--tr-fast);
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 1.8rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

@media (max-width: 768px) {
  .hero-body {
    margin-top: -45px;
    padding: 0 1.2rem 1.5rem 1.2rem;
  }
  .avatar-wrapper {
    width: 90px;
    height: 90px;
  }
  .profile-title {
    font-size: 1.7rem;
  }
  .mini-player-bar {
    padding: 0 1rem;
    height: 68px;
  }
  .mini-extra-controls {
    display: none;
  }
  .mini-track-info {
    max-width: 150px;
  }
}
