/* ==========================================================================
   GLOBAL VARIABLES & RESET
   ========================================================================== */
:root {
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-alt: #0b0f19;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.35);
  --accent: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(99, 102, 241, 0.4);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   TYPOGRAPHY & UTILITIES
   ========================================================================== */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.text-gradient {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.bg-alt {
  background-color: rgba(11, 15, 25, 0.6);
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-header.center {
  text-align: center;
}

.section-subtitle {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-desc {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-color-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

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

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition);
  padding: 1.25rem 0;
}

#navbar.scrolled {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.logo-bracket {
  color: var(--cyan);
}

.logo-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}

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

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

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Menu Active State */
.hamburger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--cyan);
  margin-bottom: 1.5rem;
}

.badge-pulse {
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.social-label {
  font-size: 0.85rem;
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icons a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.social-icons a:hover {
  color: var(--text-main);
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* Visual Card Component */
.visual-card-wrapper {
  position: relative;
}

.visual-card {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.code-header {
  background: #161b22;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.code-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dark);
}

.code-block {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  color: #c9d1d9;
}

.kwd { color: #ff7b72; }
.def { color: #d2a8ff; }
.prop { color: #79c0ff; }
.str { color: #a5d6ff; }

.floating-stat {
  position: absolute;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: float 6s ease-in-out infinite;
}

.stat-1 {
  top: -20px;
  right: -20px;
}

.stat-2 {
  bottom: -20px;
  left: -20px;
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.icon-stat {
  font-size: 1.5rem;
  color: var(--cyan);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-weight: 800;
  font-size: 1.1rem;
}

.stat-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ABOUT SECTION & SKILLS
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.lead-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.skills-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: var(--radius-md);
}

.skills-card h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.skills-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.skill-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

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

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

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

.project-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-img-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

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

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

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

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

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

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
}

.project-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.project-link:hover {
  color: var(--cyan);
}

/* ==========================================================================
   TIMELINE & EXPERIENCE
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  height: 100%;
  width: 2px;
  background: var(--border-color);
}

@media (min-width: 768px) {
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

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

.timeline-dot {
  position: absolute;
  left: 14px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  z-index: 2;
}

@media (min-width: 768px) {
  .timeline-dot {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-content {
  margin-left: 50px;
  padding: 1.75rem;
}

@media (min-width: 768px) {
  .timeline-item:nth-child(odd) .timeline-content {
    margin-left: 0;
    margin-right: calc(50% + 30px);
  }
  .timeline-item:nth-child(even) .timeline-content {
    margin-left: calc(50% + 30px);
  }
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 0.3rem;
}

.timeline-role {
  font-size: 1.2rem;
  font-weight: 700;
}

.timeline-company {
  display: block;
  color: var(--text-dark);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.timeline-tags span {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: var(--text-muted);
}

/* ==========================================================================
   SERVICES SECTION
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.service-card {
  padding: 2rem;
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-glow);
}

.service-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

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

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  padding: 3rem;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-item i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.detail-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.detail-value {
  font-weight: 600;
  color: var(--text-main);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 10px var(--primary-glow);
}

.form-submit-btn {
  margin-top: 0.5rem;
  justify-content: center;
}

/* ==========================================================================
   FOOTER & MODAL & TOASTS
   ========================================================================== */
footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-alt);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left p {
  color: var(--text-dark);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.back-to-top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.back-to-top:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-4px);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  position: relative;
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  background: none;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text-main);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out forward;
}

.toast.success {
  border-left: 4px solid var(--cyan);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-socials {
    justify-content: center;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: rgba(7, 9, 14, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    z-index: 999;
  }
  
  .nav-links.active {
    right: 0;
  }
  
  .nav-btn {
    display: none;
  }
}