:root {
  --primary: #9D4EDD;
  --primary-light: #C77DFF;
  --primary-dark: #7B2CBF;
  --accent: #5c0099;
  --dark: #0f0f13;
  --darker: #08080b;
  --card-bg: #18181f;
  --card-hover: #20202a;
  --border-subtle: rgba(157, 78, 221, 0.2);
  --border-light: rgba(255, 255, 255, 0.08);
  --light: #f0f0f5;
  --text-muted-custom: #a8a8b8;
  --gray: #262630;
  --success-accent: #10b981;
  --info-accent: #38bdf8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--dark);
  color: var(--light);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

/* Typography & Colors */
.text-primary {
  color: var(--primary) !important;
}

.text-primary-light {
  color: var(--primary-light) !important;
}

.text-muted-custom {
  color: var(--text-muted-custom) !important;
}

.bg-darker {
  background-color: var(--darker) !important;
}

.bg-card {
  background-color: var(--card-bg) !important;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: 1px solid var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(157, 78, 221, 0.3);
}

.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.45);
  color: #fff;
}

.btn-outline-light {
  border-radius: 8px;
  font-weight: 600;
  border-width: 1.5px;
  transition: all 0.25s ease;
}

.btn-outline-light:hover {
  background: #fff;
  color: var(--darker);
  transform: translateY(-2px);
}

.btn-outline-primary-custom {
  color: var(--primary-light);
  border: 1px solid rgba(157, 78, 221, 0.45);
  background: rgba(157, 78, 221, 0.08);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-outline-primary-custom:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(157, 78, 221, 0.35);
}

/* Navbar */
.navbar {
  background-color: rgba(8, 8, 11, 0.88) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 0;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.3px;
  font-size: 1.3rem;
}

.nav-link {
  color: var(--light) !important;
  font-weight: 500;
  margin: 0 8px;
  font-size: 0.95rem;
  transition: color 0.25s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-light) !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 8px;
  right: 8px;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  padding: 7rem 0 4rem;
  background:
    radial-gradient(circle at 15% 25%, rgba(157, 78, 221, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(92, 0, 153, 0.16) 0%, transparent 50%),
    linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
  display: flex;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(157, 78, 221, 0.12);
  border: 1px solid rgba(157, 78, 221, 0.35);
  color: var(--primary-light);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.profile-img-wrapper {
  position: relative;
  display: inline-block;
}

.profile-img {
  max-width: 480px;
  width: 100%;
  border-radius: 24px;
  border: 3px solid var(--primary);
  box-shadow: 0 16px 40px rgba(157, 78, 221, 0.35);
  transition: transform 0.35s ease;
}

.profile-img:hover {
  transform: translateY(-5px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.hero-stat-item h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 0.15rem;
}

.hero-stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted-custom);
  margin-bottom: 0;
}

/* Section Layout */
.section-padding {
  padding: 5.5rem 0;
}

.section-subtitle {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-light);
  display: block;
  margin-bottom: 0.5rem;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(157, 78, 221, 0.12);
  border-color: var(--border-subtle);
}

/* Project Cards */
.project-card {
  background: var(--card-bg);
  color: var(--light);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border-light);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5), 0 0 25px rgba(157, 78, 221, 0.2);
  border-color: rgba(157, 78, 221, 0.5);
}

.project-img-container {
  height: 220px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1b1528 0%, #111118 100%);
}

.project-card img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover img.card-img-top {
  transform: scale(1.06);
}

.project-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 10, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(157, 78, 221, 0.45);
  color: var(--primary-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  z-index: 2;
}

.project-date-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 10, 14, 0.82);
  backdrop-filter: blur(8px);
  color: var(--text-muted-custom);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  z-index: 2;
}

.project-visual-banner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.project-visual-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(157, 78, 221, 0.28), transparent 60%),
    linear-gradient(135deg, #1a1326 0%, #0f1018 100%);
  z-index: 0;
}

.project-visual-banner > * {
  position: relative;
  z-index: 1;
}

.project-visual-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(157, 78, 221, 0.16);
  border: 1px solid rgba(157, 78, 221, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.project-card:hover .project-visual-icon {
  transform: scale(1.1);
}

.project-metrics-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.metric-pill {
  background: rgba(157, 78, 221, 0.12);
  border: 1px solid rgba(157, 78, 221, 0.28);
  color: #e9d5ff;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
}

.tech-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted-custom);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Filter buttons */
.filter-btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  color: var(--text-muted-custom);
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(157, 78, 221, 0.35);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 34px;
}

.timeline::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), rgba(157, 78, 221, 0.2));
  left: 6px;
  top: 5px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 3px solid var(--dark);
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.35);
  left: -34px;
  top: 6px;
}

.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.timeline-card:hover {
  border-color: var(--border-subtle);
  transform: translateX(4px);
}

/* Tables & Progress */
.table {
  color: var(--light);
  border-radius: 10px;
  overflow: hidden;
}

.progress {
  height: 8px;
  background-color: var(--gray);
}

.progress-bar {
  background-color: var(--primary);
}

/* Social Icons */
.social-icons a {
  color: var(--light);
  font-size: 1.4rem;
  margin: 0 10px;
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-block;
}

.social-icons a:hover {
  color: var(--primary-light);
  transform: translateY(-2px);
}

/* Project Subpage Specific Styles */
.project-hero {
  padding: 7.5rem 0 3.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(157, 78, 221, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, var(--darker) 0%, var(--dark) 100%);
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.breadcrumb-custom a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumb-custom a:hover {
  color: #fff;
  text-decoration: underline;
}

.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.35rem;
  height: 100%;
  text-align: center;
}

.stat-box .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.stat-box .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted-custom);
  margin-bottom: 0;
}

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 2rem;
  margin-bottom: 1.75rem;
}

.detail-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.detail-card h3 i {
  color: var(--primary-light);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--border-light);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table th {
  padding: 0.85rem 0.5rem;
  color: var(--text-muted-custom);
  font-weight: 500;
  font-size: 0.9rem;
  width: 42%;
}

.spec-table td {
  padding: 0.85rem 0.5rem;
  color: var(--light);
  font-weight: 600;
  font-size: 0.92rem;
}

.process-step {
  display: flex;
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.process-step:last-child {
  margin-bottom: 0;
}

.process-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(157, 78, 221, 0.2);
  border: 1px solid var(--primary);
  color: var(--primary-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.engineering-callout {
  background: rgba(157, 78, 221, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.project-nav-footer {
  border-top: 1px solid var(--border-light);
  padding: 3rem 0;
  background: var(--darker);
}

.project-nav-card {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: all 0.25s ease;
  color: var(--light);
  height: 100%;
}

.project-nav-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  color: #fff;
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.animate-on-scroll.active {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  animation: fadeIn 0.9s ease forwards;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 5px;
}

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

@media (max-width: 768px) {
  .hero-section {
    padding-top: 6rem;
    text-align: center;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .section-padding {
    padding: 4rem 0;
  }
  .detail-card {
    padding: 1.35rem;
  }
}
