/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-section-alt: #f1f5f9;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-light: #ede9fe;
  --accent-dark: #4f46e5;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 25px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-accent: 0 8px 24px -4px rgb(99 102 241 / 0.25);
  --radius: 12px;
  --radius-lg: 20px;
  --nav-h: 68px;
  --max-w: 1140px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--accent); }
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-section-alt); }
.nav-link.active { color: var(--accent); }
.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
}
.nav-cta:hover { opacity: 0.9; background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
}
.hero-bg-blur {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
}
.hero-bg-blur.b1 {
  width: 600px; height: 600px;
  background: var(--accent);
  top: -100px; left: -150px;
}
.hero-bg-blur.b2 {
  width: 500px; height: 500px;
  background: var(--accent-2);
  bottom: -80px; right: -120px;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.badge-dot {
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}
.hero-role {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.br-desktop { display: block; }
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { box-shadow: 0 12px 30px -4px rgb(99 102 241 / 0.35); }
.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { box-shadow: var(--shadow-md); }

/* Floating badges */
.hero-badges-float {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.float-badge {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  animation: floatBadge 6s ease-in-out infinite;
}
.fb1 { top: 18%; left: 6%;  animation-delay: 0s;    animation-duration: 7s; }
.fb2 { top: 30%; left: 2%;  animation-delay: 1.2s;  animation-duration: 6s; }
.fb3 { top: 55%; left: 5%;  animation-delay: 0.5s;  animation-duration: 8s; }
.fb4 { top: 70%; left: 8%;  animation-delay: 2s;    animation-duration: 7s; }
.fb5 { top: 18%; right: 6%; animation-delay: 0.8s;  animation-duration: 6.5s; }
.fb6 { top: 35%; right: 2%; animation-delay: 1.8s;  animation-duration: 7.5s; }
.fb7 { top: 58%; right: 5%; animation-delay: 0.3s;  animation-duration: 6s; }
.fb8 { top: 72%; right: 7%; animation-delay: 1.5s;  animation-duration: 8s; }

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

.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-light);
  animation: bounce 2s ease-in-out infinite;
  z-index: 1;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ============================================================
   SECTIONS COMMON
   ============================================================ */
.section { padding: 100px 0; }
.section.projects { background: var(--bg-section-alt); }

.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.about-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.about-card-inner { display: flex; flex-direction: column; gap: 24px; }
.about-card-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.about-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: var(--accent-light);
  border-radius: 10px;
  padding: 8px;
  color: var(--accent);
}
.about-card-row div { display: flex; flex-direction: column; gap: 2px; }
.about-card-row strong { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.about-card-row span { font-size: 0.83rem; color: var(--text-muted); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}
.project-card--featured {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(139, 92, 246, 0.03));
}
.project-featured-badge {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 100px;
}
.project-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.project-icon svg { width: 26px; height: 26px; }
.pi-blue   { background: #dbeafe; color: #2563eb; }
.pi-teal   { background: #ccfbf1; color: #0d9488; }
.pi-violet { background: #ede9fe; color: #7c3aed; }
.pi-rose   { background: #ffe4e6; color: #e11d48; }

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.project-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.project-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  font-family: 'JetBrains Mono', monospace;
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 10px;
  border-radius: 6px;
}
.tag-python  { background: #fef9c3; color: #854d0e; }
.tag-api     { background: #dcfce7; color: #166534; }
.tag-db      { background: #dbeafe; color: #1e40af; }
.tag-auth    { background: #fce7f3; color: #9d174d; }
.tag-flutter { background: #e0f2fe; color: #0369a1; }
.tag-dart    { background: #e0f2fe; color: #0369a1; }
.tag-node    { background: #dcfce7; color: #15803d; }
.tag-vue     { background: #d1fae5; color: #065f46; }
.tag-dotnet  { background: #ede9fe; color: #5b21b6; }
.tag-neutral { background: var(--bg-section-alt); color: var(--text-muted); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}
.skill-cat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.skill-cat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.skill-cat-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.skill-cat-title svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.skill-list { display: flex; flex-direction: column; gap: 10px; }
.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.skill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sd-python  { background: #ca8a04; }
.sd-api     { background: #16a34a; }
.sd-node    { background: #15803d; }
.sd-dotnet  { background: #7c3aed; }
.sd-vue     { background: #059669; }
.sd-flutter { background: #0369a1; }
.sd-db      { background: #2563eb; }
.sd-neutral { background: var(--text-light); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 60px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.contact-left .section-label { margin-bottom: 12px; display: inline-block; }
.contact-left .section-title { margin-bottom: 16px; }
.contact-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.contact-right { display: flex; flex-direction: column; gap: 14px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}
.contact-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}
.contact-card-icon {
  width: 44px; height: 44px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-card-icon svg { width: 20px; height: 20px; }
.ci-linkedin { background: #dbeafe; color: #2563eb; }
.contact-card-text {
  display: flex; flex-direction: column;
  flex: 1; min-width: 0;
}
.contact-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}
.contact-card-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-card-arrow { width: 18px; height: 18px; color: var(--text-light); flex-shrink: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--text);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.footer-logo .accent { color: #a5b4fc; }
.footer-copy { font-size: 0.82rem; color: #64748b; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.animate-init {
  opacity: 0;
  transform: translateY(20px);
}
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Staggered hero */
.animate-init.ready { animation: fadeSlideUp 0.6s ease forwards; }
.animate-init.ready:nth-child(1) { animation-delay: 0.05s; }
.animate-init.ready:nth-child(2) { animation-delay: 0.15s; }
.animate-init.ready:nth-child(3) { animation-delay: 0.25s; }
.animate-init.ready:nth-child(4) { animation-delay: 0.35s; }
.animate-init.ready:nth-child(5) { animation-delay: 0.45s; }

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

/* Stagger for grid children */
.projects-grid .animate-on-scroll.visible:nth-child(2) { transition-delay: 0.1s; }
.projects-grid .animate-on-scroll.visible:nth-child(3) { transition-delay: 0.2s; }
.projects-grid .animate-on-scroll.visible:nth-child(4) { transition-delay: 0.3s; }
.skills-categories .animate-on-scroll .skill-cat:nth-child(2) { transition-delay: 0.1s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-box {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px;
  }
  .float-badge { display: none; }
  .br-desktop { display: none; }
}

@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; gap: 4px; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(248, 250, 252, 0.97);
    backdrop-filter: blur(12px);
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-toggle { display: flex; }
  .section { padding: 70px 0; }
  .hero { padding-top: calc(var(--nav-h) + 20px); }
  .hero-title { font-size: 2rem; }
  .about-stats { gap: 20px; }
  .skills-categories { grid-template-columns: repeat(2, 1fr); }
  .contact-box { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .skills-categories { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .about-stats { flex-direction: column; gap: 16px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .contact-card-value { font-size: 0.8rem; }
}
