/* ==============================
   CSS VARIABLES — DARK SLATE + PURPLE
============================== */
:root {
  --bg-primary: #13111a;
  --bg-secondary: #1a1726;
  --bg-card: #1e1a2e;
  --bg-card-hover: #231f35;
  --purple: #7c3aed;
  --purple-light: #9d6ff7;
  --purple-dim: rgba(124, 58, 237, 0.15);
  --purple-border: rgba(124, 58, 237, 0.25);
  --lavender: #a78bfa;
  --text-primary: #f0eeff;
  --text-secondary: #9d8ec4;
  --text-muted: #6b5f8a;
  --border: #2d2545;
  --border-hover: #4c3575;
  --font-mono: 'Share Tech Mono', monospace;
  --font-main: 'Inter', sans-serif;
  --transition: all 0.3s ease;
  --shadow-purple: 0 0 30px rgba(124, 58, 237, 0.2);
}

/* ==============================
   RESET & BASE
============================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 2px; }

/* Selection */
::selection { background: var(--purple-dim); color: var(--lavender); }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.highlight { color: var(--lavender); }

section { padding: 100px 0; }

/* ==============================
   BUTTONS
============================== */
.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  border-radius: 4px;
  border: 2px solid var(--purple);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: transparent;
  color: var(--lavender);
  box-shadow: var(--shadow-purple);
}

.btn-outline {
  display: inline-block;
  padding: 12px 32px;
  background: transparent;
  color: var(--lavender);
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  border-radius: 4px;
  border: 2px solid var(--purple-border);
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline:hover {
  border-color: var(--purple);
  background: var(--purple-dim);
  box-shadow: var(--shadow-purple);
}

.btn-full { width: 100%; text-align: center; }

/* ==============================
   SECTION HEADER
============================== */
.section-header { margin-bottom: 56px; }

.section-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--lavender);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.section-line {
  width: 48px;
  height: 2px;
  background: var(--purple);
}

/* ==============================
   NAVBAR
============================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition);
}

#navbar.scrolled {
  background: rgba(19, 17, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-logo .bracket { color: var(--purple-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--purple-light);
  transition: var(--transition);
}

.nav-links a:hover { color: var(--lavender); }
.nav-links a:hover::after { width: 100%; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--lavender);
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Nav */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: rgba(19, 17, 26, 0.98);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  gap: 16px;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-mobile a:hover { color: var(--lavender); }

/* ==============================
   RESPONSIVE — PORTFOLIO
============================== */

/* Tablet — 1024px */
@media (max-width: 1024px) {

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .photo-frame {
    width: 240px;
    height: 240px;
    margin: 0 auto 16px;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Skills marquee */
  .marquee-content {
    gap: 8px;
  }
}

/* Mobile — 768px */
@media (max-width: 768px) {

  /* Global */
  section { padding: 70px 0; }

  .section-title { font-size: 26px; }

  .container { padding: 0 18px; }

  /* Navbar */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .nav-container {
    padding: 0 18px;
  }

  /* Hero */
  #hero { padding: 0 18px; }

  #hero h1 {
    font-size: clamp(32px, 10vw, 52px);
    letter-spacing: -1px;
  }

  .typing-wrapper {
    font-size: clamp(14px, 4vw, 18px);
    height: 30px;
  }

  .hero-desc {
    font-size: 14px;
    padding: 0 8px;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    max-width: 280px;
    text-align: center;
    padding: 12px 24px;
  }

  .hero-stats {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 24px;
  }

  .hero-stat h3 { font-size: 22px; }
  .hero-stat p  { font-size: 9px; }

  .scroll-indicator { display: none; }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .photo-frame {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  .about-info h3 { font-size: 18px; }
  .about-info p  { font-size: 13px; }

  .about-details {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .detail-item { padding: 10px; }
  .detail-value { font-size: 12px; }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card { padding: 20px 12px; }
  .stat-card h3 { font-size: 26px; }
  .stat-card p  { font-size: 9px; }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-btns {
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 10px;
  }

  .project-card { padding: 20px; }

  /* Skills Marquee */
  .pill {
    padding: 6px 12px;
    gap: 6px;
  }

  .pill img,
  .pill-emoji {
    width: 16px;
    height: 16px;
    font-size: 14px;
  }

  .pill span { font-size: 11px; }

  .marquee-content { gap: 8px; }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .testimonial-card { padding: 18px; }

  .feedback-cta {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 16px;
  }

  .feedback-cta-text h3 { font-size: 17px; }
  .feedback-cta .btn-primary {
    width: 100%;
    max-width: 280px;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-info h3 { font-size: 20px; }

  .contact-form-wrapper { padding: 24px 20px; }

  .social-links { justify-content: center; }

  /* Feedback Modal */
  .modal-overlay { padding: 16px; }

  .modal-box {
    padding: 24px 20px;
    max-height: 95vh;
  }

  .modal-title { font-size: 18px; }

  .star { font-size: 20px; }

  /* Footer */
  #footer { padding: 28px 0; }
  .footer-logo { font-size: 17px; }
  .footer-text { font-size: 12px; padding: 0 20px; }

  /* Theme switch — smaller */
  .switch-track {
    width: 44px;
    height: 22px;
  }

  .switch-thumb {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .switch-icon { font-size: 12px; }
}

/* Small Mobile — 480px */
@media (max-width: 480px) {

  /* Hero */
  #hero h1 {
    font-size: clamp(28px, 11vw, 42px);
  }

  .hero-status {
    font-size: 9px;
    padding: 5px 14px;
    letter-spacing: 2px;
  }

  .hero-stats {
    gap: 12px;
  }

  .hero-stat {
    min-width: 60px;
    text-align: center;
  }

  /* About */
  .about-details {
    grid-template-columns: 1fr;
  }

  .photo-frame {
    width: 180px;
    height: 180px;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Projects */
  .project-card { padding: 16px; }
  .project-icon { font-size: 26px; }
  .project-card h3 { font-size: 14px; }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Skill pills */
  .pill {
    padding: 5px 10px;
  }

  .pill span { font-size: 10px; }

  /* Section */
  .section-title { font-size: 24px; }
  .section-tag   { font-size: 10px; letter-spacing: 3px; }

  /* Nav logo */
  .nav-logo { font-size: 16px; }

  /* Buttons */
  .btn-primary,
  .btn-outline {
    font-size: 11px;
    padding: 11px 20px;
  }

  /* Contact form */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 13px;
    padding: 10px 14px;
  }

  /* Modal */
  .modal-box { padding: 20px 16px; }

  .btn-google { font-size: 13px; }
}

/* Extra Small — 360px */
@media (max-width: 360px) {

  .container { padding: 0 14px; }

  #hero h1 { font-size: 26px; }

  .hero-stats { gap: 10px; }
  .hero-stat h3 { font-size: 18px; }

  .stats-grid { gap: 8px; }
  .stat-card h3 { font-size: 22px; }

  .nav-logo { font-size: 15px; }

  .photo-frame {
    width: 160px;
    height: 160px;
  }
}


/* ==============================
   SCROLL ANIMATIONS — FADE + SLIDE UP
============================== */

/* Hidden state */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Visible state */
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delay variations */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ==============================
   DARK / LIGHT MODE TOGGLE
============================== */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch-icon {
  font-size: 14px;
  user-select: none;
}

.switch-track {
  width: 52px;
  height: 26px;
  background: var(--purple);
  border-radius: 100px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.switch-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  right: 3px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Light mode — thumb moves to left */
body.light-mode .switch-thumb {
  right: auto;
  left: 3px;
}

body.light-mode .switch-track {
  background: #e2e8f0;
}

/* ==============================
   LIGHT MODE COLORS
============================== */
body.light-mode {
  --bg-primary: #f8f7ff;
  --bg-secondary: #f0eeff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f3ff;
  --text-primary: #1e1a2e;
  --text-secondary: #4c3575;
  --text-muted: #9d8ec4;
  --border: #ddd6fe;
  --border-hover: #a78bfa;
  --shadow-purple: 0 0 30px rgba(124, 58, 237, 0.1);
}

body.light-mode #navbar.scrolled {
  background: rgba(248, 247, 255, 0.95);
}

body.light-mode .nav-mobile {
  background: rgba(248, 247, 255, 0.98);
}

body.light-mode .hero-grid-bg {
  background-image:
    linear-gradient(rgba(124,58,237,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.06) 1px, transparent 1px);
}

body.light-mode .marquee-track::before {
  background: linear-gradient(to right, var(--bg-secondary), transparent);
}

body.light-mode .marquee-track::after {
  background: linear-gradient(to left, var(--bg-secondary), transparent);
}

body.light-mode ::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

  
/* ==============================
   FEEDBACK MODAL
============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--purple-border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  border-color: var(--purple);
  color: var(--lavender);
  background: var(--purple-dim);
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Google Button */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}

.btn-google:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-google img {
  width: 18px;
  height: 18px;
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.modal-divider span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.star {
  font-size: 24px;
  color: var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.star.active,
.star:hover {
  color: #f59e0b;
}

#feedback-response {
  margin-top: 14px;
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: center;
  padding: 10px;
  border-radius: 4px;
}

#feedback-response.success {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

#feedback-response.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 640px) {
  .feedback-cta {
    flex-direction: column;
    text-align: center;
  }
}



/* ==============================
   DYNAMIC PROJECTS
============================== */

/* Loading State */
.projects-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.projects-loading p {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Empty State */
.projects-empty {
  text-align: center;
  padding: 60px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ==============================
   CONTACT FORM ENHANCEMENTS
============================== */

/* Focused state */
.form-group.focused label {
  color: var(--lavender);
}

/* Input valid state */
.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
  border-color: rgba(34, 197, 94, 0.4);
}

/* Submit button loading state */
#contact-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Form response */
#form-response {
  margin-top: 14px;
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  transition: var(--transition);
}

#form-response.success {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

#form-response.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==============================
   GOOGLE OAUTH
============================== */
.google-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--purple-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

#google-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.google-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.google-profile-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.google-signout-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.google-signout-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}