/* ==========================================================================
   PORTFOLIO DESIGN SYSTEM
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONTS & THEME DESIGN SYSTEM (VARS)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, monospace;

  /* Colors - Dark Theme (Default) */
  --bg-color: #0b0f17;
  --bg-surface: #131a26;
  --bg-surface-hover: #1c2637;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1; /* Indigo */
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  --selection-bg: #6366f1;
  --selection-text: #ffffff;
  
  --max-width: 1000px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

/* Colors - Light Theme overrides */
body.light-theme {
  --bg-color: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #3730a3;
  --accent-light: rgba(79, 70, 229, 0.08);
  --border: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(79, 70, 229, 0.4);
  --shadow: 0 4px 30px rgba(15, 23, 42, 0.05);
  --selection-bg: #4f46e5;
  --selection-text: #ffffff;
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & SCROLLBAR
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --------------------------------------------------------------------------
   3. STRUCTURAL UTILITIES & SECTIONS
   -------------------------------------------------------------------------- */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

section {
  padding: 100px 0 60px 0;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
  position: relative;
}

/* --------------------------------------------------------------------------
   4. NAVIGATION BAR HEADER
   -------------------------------------------------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  background-color: rgba(11, 15, 23, 0.7);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

body.light-theme header {
  background-color: rgba(248, 250, 252, 0.7);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.05em;
}

.logo span {
  color: var(--accent);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition-smooth);
}

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

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

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.sun-icon { display: none; }
.moon-icon { display: block; }

body.light-theme .sun-icon { display: block; }
body.light-theme .moon-icon { display: none; }

/* Mobile Menu Trigger Button */
.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 110;
}

/* --------------------------------------------------------------------------
   5. HERO / INTRODUCTION BANNER
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
}

.hero-content {
  max-width: 680px;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 20px;
  display: block;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.hero-actions {
  display: flex;
  gap: 16px;
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   6. SELECTED PROJECTS GRID
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  opacity: 0;
  transition: var(--transition-smooth);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}

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

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.project-icon {
  color: var(--accent);
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-link {
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.project-link:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

.project-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.project-tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   7. EDUCATION TIMELINE
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background: var(--border);
  top: 8px;
  bottom: 8px;
  left: 32px;
}

.timeline-item {
  padding: 0 0 40px 80px;
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: 24px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 3px solid var(--accent);
  z-index: 2;
  transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
  transform: scale(1.2);
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.timeline-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-company {
  color: var(--accent);
  font-weight: 500;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   8. ABOUT, SKILLS & CERTIFICATIONS
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 60px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

/* Skill Categories Column */
.skills-categories {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skill-category-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 6px 14px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: var(--transition-fast);
  cursor: default;
}

.skill-pill:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Certifications Layout */
.certificates-section {
  margin-top: 40px;
}

.certificates-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition-smooth);
  text-decoration: none;
  color: inherit;
}

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

.cert-card svg, .cert-card i {
  color: var(--accent);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.cert-info h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.cert-info p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   9. CONTACT FORM & INFO CARDS
   -------------------------------------------------------------------------- */
.contact-container {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-info-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.contact-details h4 {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-details p, .contact-details a {
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

.contact-details a:hover {
  color: var(--accent);
}

/* Form Styling */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  position: relative;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  outline: none;
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-label {
  position: absolute;
  left: 16px;
  top: 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

/* Form floating label focus animations */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-textarea:focus ~ .form-label,
.form-textarea:not(:placeholder-shown) ~ .form-label {
  top: -8px;
  left: 10px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  background-color: var(--bg-color);
  padding: 0 6px;
  border-radius: 4px;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-status {
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-status.success {
  display: block;
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-status.error {
  display: block;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --------------------------------------------------------------------------
   10. FOOTER
   -------------------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  transition: border-color 0.4s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.social-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.social-links a {
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.copyright {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. BACK TO TOP BUTTON
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow);
}

.back-to-top:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

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

/* --------------------------------------------------------------------------
   12. INTERSECTIONOBSERVER REVEALS & KEYFRAMES
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

/* --------------------------------------------------------------------------
   13. RESPONSIVE MEDIA QUERIES (MOBILE DEV)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  section {
    padding: 80px 0 40px 0;
  }
  
  .section-title {
    font-size: 1.85rem;
    margin-bottom: 30px;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    gap: 24px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 90;
  }

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

  .menu-btn {
    display: block;
  }

  .about-grid, .contact-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .timeline::after {
    left: 16px;
  }
  
  .timeline-item {
    padding-left: 48px;
  }
  
  .timeline-dot {
    left: 8px;
  }

  .hero {
    padding-top: 140px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* --------------------------------------------------------------------------
   14. 404 ERROR PAGE STYLES
   -------------------------------------------------------------------------- */
.error-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  text-align: center;
  padding: 120px 0 60px 0;
}

.error-container {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
  animation: float 6s ease-in-out infinite;
}

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

.error-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: -10px;
}

.error-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.error-illustration {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Adjustments for Error page responsive styles */
@media (max-width: 768px) {
  .error-section {
    min-height: calc(100vh - 170px);
    padding: 140px 0 60px 0;
  }
  
  .error-code {
    font-size: 6rem;
  }
  
  .error-title {
    font-size: 1.6rem;
  }
}

