/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --fg-primary: #f1f5f9;
  --fg-secondary: #94a3b8;
  --fg-muted: #64748b;
  --accent: #f97316;
  --accent-secondary: #fb923c;
  --accent-glow: rgba(249, 115, 22, 0.15);
  --card-border: rgba(249, 115, 22, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg-primary);
  color: var(--fg-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: var(--accent);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  color: var(--accent-secondary);
}

/* ---------- DRAGON BACKGROUND (NEW) ---------- */
#dragon-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none; /* Allows clicks to pass through */
  overflow: hidden;
  perspective: 1000px;
}

.dragon-visual {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vmax; /* Very large, covers whole screen */
  height: 150vmax;
  transform: translate(-50%, -50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23f97316' d='M464.7 278.3c-9.5-9.5-22.9-13.7-35.9-11.3l-41.7 8.3c-7.1 1.4-13.4 5.2-17.7 10.8l-34.7 44.2c-5.4 6.9-13.4 11-22 11h-31.6c-8.2 0-16.1-3.6-21.5-9.8l-35.7-40.2c-4.7-5.3-11.3-8.5-18.2-9l-45.1-2.9c-6.5-.4-12.6-3.3-17-8l-29.2-30.8c-5-5.3-7.8-12.4-7.6-19.7l1.2-45.9c.2-7.2 3.2-14.1 8.3-19.1l31.3-30.6c5.2-5.1 12.1-7.9 19.3-7.8l45.3.4c7.4.1 14.5-2.9 19.7-8.2l32.2-33.1c5.4-5.5 12.7-8.6 20.4-8.5l41.9.4c7.2.1 14.1 3 19.1 8.1l30.7 31.4c5 5.2 7.8 12.1 7.7 19.3l-.3 25.7c-.1 8.4-3.9 16.4-10.4 21.8l-42.9 35.9c-4.4 3.7-7.5 8.7-8.9 14.3l-6.8 27.2' opacity='0.15'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.5; /* Watermark effect */
  filter: blur(2px) drop-shadow(0 0 40px rgba(249, 115, 22, 0.2));
  animation: dragonFloat 20s infinite ease-in-out;
  transition: transform 0.2s ease-out;
}

@keyframes dragonFloat {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  25% { transform: translate(-45%, -55%) rotate(5deg) scale(1.05); }
  50% { transform: translate(-55%, -45%) rotate(-5deg) scale(1); }
  75% { transform: translate(-48%, -52%) rotate(3deg) scale(1.02); }
}

/* ---------- Header ---------- */
header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(180deg, rgba(10, 15, 26, 0.9) 0%, transparent 100%);
}

.header-content {
  max-width: 600px;
  margin: 0 auto 30px;
}

.profile-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 25px;
}

.profile-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent, var(--accent));
  animation: spin 8s linear infinite;
}

.profile-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.profile-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-primary);
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.name-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  background: linear-gradient(135deg, var(--fg-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.name-nepali {
  font-size: 1.4rem;
  color: var(--fg-secondary);
  margin-bottom: 15px;
  font-weight: 500;
}

.tagline {
  font-weight: 400;
  font-size: 1rem;
  color: var(--fg-muted);
  margin-bottom: 25px;
}

/* ---------- Social Navigation ---------- */
.social-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.social-nav a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--fg-secondary);
  font-size: 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

/* ---------- Main Navigation ---------- */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 15px 0;
  border-top: 1px solid var(--glass-border);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link i {
  font-size: 0.85rem;
  color: var(--accent);
}

.nav-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.nav-link:hover i {
  color: var(--bg-primary);
}

/* ---------- Main Content ---------- */
main {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- Sections ---------- */
section {
  margin-bottom: 50px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  margin-bottom: 25px;
}

.section-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--fg-primary);
  display: inline-block;
  position: relative;
}

.section-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: 10px;
  border-radius: 2px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 25px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
}

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

.card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--fg-primary);
}

.card p {
  color: var(--fg-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.card strong {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Card Variants ---------- */
.glass-card {
  background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(249, 115, 22, 0.02) 100%);
}

.card-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 1.3rem;
  color: var(--bg-primary);
}

/* ---------- Timeline Elements (Dot Removed from HTML, styles kept for other uses) ---------- */
.timeline-date {
  color: var(--fg-muted) !important;
  font-size: 0.9rem !important;
  margin-top: 5px;
}

/* ---------- Certificates ---------- */
.certification-card {
  text-align: center;
}

.certification-card h3 {
  margin-top: 10px;
}

.certificate-img {
  width: 90%;
  max-width: 400px;
  margin: 20px auto 0;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.certificate-img:hover {
  transform: scale(1.02);
}

/* ---------- Experience Cards ---------- */
.experience-card {
  position: relative;
}

.experience-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.experience-year {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(249, 115, 22, 0.1);
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
}

.current-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bg-primary);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Contact Section ---------- */
.contact-card {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 250px;
}

.contact-item i {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.contact-item strong {
  display: block;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
  font-weight: 500;
}

.contact-item a {
  font-size: 1rem;
  color: var(--fg-primary);
  font-weight: 500;
}

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

/* ---------- Typing Tool ---------- */
.typing-frame {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.tool-credit {
  font-size: 0.8rem;
  text-align: center;
  margin: 15px 0;
  color: var(--fg-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: var(--bg-primary);
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
  color: var(--bg-primary);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--card-border);
  color: var(--fg-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 15px;
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(180deg, transparent, rgba(10, 15, 26, 0.9));
  border-top: 1px solid var(--glass-border);
}

footer p {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .profile-ring { animation: none; background: var(--accent); }
  .dragon-visual { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  header { padding: 40px 15px 30px; }
  .profile-wrapper { width: 120px; height: 120px; }
  .main-nav { gap: 6px; }
  .nav-link { padding: 8px 14px; font-size: 0.85rem; }
  .nav-link span { display: none; }
  .nav-link i { font-size: 1rem; color: inherit; }
  .nav-link:hover i { color: var(--bg-primary); }
  main { padding: 15px; }
  .card { padding: 20px; }
  .contact-card { flex-direction: column; gap: 20px; }
  .contact-item { min-width: 100%; }
  .certification-card { text-align: left; }
}

@media (max-width: 480px) {
  .name-title { font-size: 1.8rem; }
  .tagline { font-size: 0.9rem; }
  .section-header h2 { font-size: 1.5rem; }
  .btn { padding: 10px 20px; font-size: 0.85rem; }
}
