/* ============================================
   PORTFOLIO - Modern Dark Theme
   Glassmorphism + Animated Gradients + Glow
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --accent-4: #ec4899;
  --gradient-primary: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  --gradient-glow: linear-gradient(135deg, var(--accent-2), var(--accent-4));
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --nav-height: 70px;
  --container-max: 1100px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-1);
  color: #fff;
}

/* --- Animated Background Orbs --- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  transition: transform 0.3s ease-out;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-1);
  top: -10%;
  left: -10%;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-3);
  top: 50%;
  right: -15%;
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-4);
  bottom: -5%;
  left: 30%;
  animation: orbFloat3 22s ease-in-out infinite;
}

.orb-4 {
  width: 350px;
  height: 350px;
  background: var(--accent-2);
  top: 30%;
  left: 50%;
  animation: orbFloat4 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(100px, 50px) scale(1.1); }
  66% { transform: translate(-50px, 100px) scale(0.9); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, -60px) scale(1.15); }
  66% { transform: translate(40px, -100px) scale(0.95); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -80px) scale(1.05); }
  66% { transform: translate(-100px, 30px) scale(0.9); }
}

@keyframes orbFloat4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, 70px) scale(1.1); }
}

/* --- Container --- */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* --- Glassmorphism Card --- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
}

/* --- Text Gradient --- */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  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);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: all var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.nav-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: all var(--transition);
}

.nav-logo:hover {
  color: #fff;
}

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

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: all var(--transition);
  transform: translateX(-50%);
}

.nav-links a:hover::after {
  width: 50%;
}

/* --- Mobile Nav Toggle --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 0 20px;
}

.hero-content {
  text-align: center;
  max-width: 750px;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-3);
  font-family: var(--font-mono);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-typing {
  font-size: 1.3rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 24px;
  min-height: 2rem;
}

.typing-prefix {
  color: var(--text-muted);
}

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

.typing-cursor {
  color: var(--accent-1);
  animation: blink 1s step-end infinite;
}

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

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

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

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover::before {
  opacity: 1;
}

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

.btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
}

/* --- Scroll Indicator --- */
.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent-1), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; height: 60px; }
  50% { opacity: 1; height: 80px; }
}

/* ============================================
   SECTIONS (General)
   ============================================ */
.section {
  position: relative;
  z-index: 1;
  padding: 100px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 50px;
  letter-spacing: -0.02em;
}

.title-number {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-1);
  display: block;
  margin-bottom: 8px;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.about-text, .about-skills {
  padding: 32px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-skills h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-3);
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: all var(--transition);
}

.skill-tag:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover::before {
  transform: scaleX(1);
}

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

.project-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-3);
}

.project-icon svg {
  width: 100%;
  height: 100%;
}

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

.project-link {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  transition: all var(--transition);
}

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

.project-link svg {
  width: 100%;
  height: 100%;
}

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

.project-card:hover .project-title {
  color: #fff;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.7;
}

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

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================
   CERTIFICATIONS SECTION
   ============================================ */
.certs-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.certs-timeline::before {
  content: '';
  position: absolute;
  left: 31px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-1), var(--accent-3), transparent);
  border-radius: 2px;
}

.cert-item {
  display: flex;
  gap: 24px;
  padding: 28px;
  position: relative;
}

.cert-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  color: var(--accent-1);
  background: var(--bg-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  z-index: 1;
  border: 2px solid var(--accent-1);
  transition: all var(--transition);
}

.cert-item:hover .cert-icon {
  background: var(--accent-1);
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.cert-icon svg {
  width: 100%;
  height: 100%;
}

.cert-content {
  flex: 1;
}

.cert-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.cert-issuer {
  color: var(--accent-3);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.cert-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cert-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-content {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
}

.contact-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 40px;
  line-height: 1.8;
}

.contact-form {
  padding: 40px;
  margin-bottom: 32px;
  text-align: left;
}

.form-group {
  position: relative;
  margin-bottom: 32px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 0 8px;
  font-size: 1rem;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  outline: none;
  transition: border-color var(--transition);
  resize: vertical;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--accent-1);
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: -8px;
  font-size: 0.75rem;
  color: var(--accent-1);
}

.form-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line {
  width: 100%;
}

.btn-submit {
  width: 100%;
  justify-content: center;
  font-family: var(--font-main);
  padding: 16px;
  margin-top: 8px;
}

.contact-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.contact-link:hover {
  color: var(--accent-3);
  transform: translateY(-2px);
}

.contact-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--glass-border);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-year {
  margin-top: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--glass-border);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1.2rem;
    padding: 12px 24px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .hero-typing {
    font-size: 1rem;
  }

  .contact-form {
    padding: 24px;
  }

  .certs-timeline::before {
    left: 27px;
  }

  .cert-item {
    padding: 20px;
    gap: 16px;
  }

  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-link {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 280px;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }
}