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

:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #1a1a24;
  --border:    rgba(255,255,255,.08);
  --accent:    #6c63ff;
  --accent2:   #a78bfa;
  --text:      #e2e2f0;
  --muted:     #8888aa;
  --white:     #ffffff;
  --radius:    12px;
  --radius-lg: 20px;
  --font:      'Inter', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* ───── SCROLLBAR ───── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ───── UTILITIES ───── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.section-label {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 48px;
  background: linear-gradient(135deg, var(--white) 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

section { padding: 100px 0; }

/* ───── BUTTONS ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(108,99,255,.4); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); transform: translateY(-2px); }

.btn-full { width: 100%; justify-content: center; }

/* ───── NAV ───── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: var(--transition);
}
#navbar.scrolled {
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 56px; width: auto; object-fit: contain; }

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  color: var(--muted);
  font-size: .9rem;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--white); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 16px 24px 20px;
  background: rgba(10,10,15,.95);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-link {
  padding: 10px 0;
  color: var(--muted);
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.mobile-link:last-child { border-bottom: none; }

/* ───── HERO ───── */
#hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-greeting {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--accent2);
  letter-spacing: .1em;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  height: 1.4em;
  margin-bottom: 0;
}

.typed { color: var(--accent2); }
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 480px;
  margin-bottom: 36px;
}

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

/* ORB BACKGROUND */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}
.orb-1 { width: 400px; height: 400px; background: rgba(108,99,255,.2); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: rgba(167,139,250,.15); bottom: 0; left: 20%; }
.orb-3 { width: 200px; height: 200px; background: rgba(108,99,255,.1); top: 50%; right: 30%; }

/* CODE CARD */
.hero-visual { display: flex; justify-content: center; align-items: center; }

.code-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
}

.code-header {
  background: var(--bg3);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.code-header .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.code-header .dot.red    { background: #ff5f57; }
.code-header .dot.yellow { background: #febc2e; }
.code-header .dot.green  { background: #28c840; }
.code-filename { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-left: 8px; }

.code-body {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.8;
  padding: 20px 20px 24px;
  overflow-x: auto;
  color: #c9d1d9;
}
.kw  { color: #ff79c6; }
.cl  { color: #8be9fd; }
.fn  { color: #50fa7b; }
.st  { color: #f1fa8c; }
.op  { color: #ff79c6; }

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  opacity: .6;
  animation: bounce 2s infinite;
}
.scroll-hint svg { width: 24px; height: 24px; }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ───── ABOUT ───── */
#about { background: var(--bg2); }

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-avatar { display: flex; flex-direction: column; align-items: center; }
}

.avatar-ring {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 3px;
  margin: 0 auto 24px;
}
.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent2);
}

.avatar-photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.about-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .82rem;
  color: var(--muted);
}

.about-text p { color: var(--muted); margin-bottom: 18px; }
.about-text strong { color: var(--text); }

/* ───── PROJECTS ───── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: rgba(108,99,255,.4);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(108,99,255,.15);
}
.project-card.featured {
  border-color: rgba(108,99,255,.3);
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(108,99,255,.08) 100%);
}

.project-tag {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent2);
  margin-bottom: 12px;
}

.project-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.project-desc {
  color: var(--muted);
  font-size: .9rem;
  flex: 1;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.project-tech li {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: .75rem;
  font-family: var(--mono);
  color: var(--muted);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent2);
  font-size: .9rem;
  font-weight: 500;
  margin-top: auto;
  transition: gap var(--transition);
}
.project-link svg { width: 16px; height: 16px; }
.project-link:hover { gap: 10px; }

/* ───── SKILLS ───── */
#skills { background: var(--bg2); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.skill-group {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.skill-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 24px;
}
.skill-group-title svg { width: 18px; height: 18px; color: var(--accent2); flex-shrink: 0; }

.skill-group ul { display: flex; flex-direction: column; gap: 16px; }
.skill-group li { display: flex; flex-direction: column; gap: 6px; }
.skill-name { font-size: .85rem; color: var(--muted); }

.skill-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(.4,0,.2,1);
}
.skill-fill.animate { transform: scaleX(1); }

/* ───── CONTACT ───── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info p { color: var(--muted); margin-bottom: 28px; font-size: 1rem; }

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent2);
  font-size: 1rem;
  margin-bottom: 32px;
  transition: color var(--transition);
}
.contact-email svg { width: 20px; height: 20px; }
.contact-email:hover { color: var(--white); }

.contact-social { display: flex; gap: 16px; }
.social-link {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  transition: var(--transition);
}
.social-link svg { width: 20px; height: 20px; }
.social-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }

/* FORM */
.contact-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .82rem; color: var(--muted); }
.form-group input,
.form-group textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
  transition: border-color var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted); opacity: .6; }

.form-note { font-size: .82rem; color: var(--accent2); min-height: 1.2em; text-align: center; }

/* ───── FOOTER ───── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
  color: var(--muted);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { transition: color var(--transition); }
.footer-links a:hover { color: var(--accent2); }

/* ───── ANIMATIONS ───── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ───── RESPONSIVE ───── */
@media (max-width: 768px) {
  /* Nav */
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .nav-inner { padding: 14px 16px; }
  .nav-logo-img { height: 44px; }

  /* General */
  section { padding: 60px 0; }
  .container { padding: 0 16px; }
  .section-title { font-size: 1.6rem; margin-bottom: 32px; }

  /* Hero */
  #hero { padding: 100px 16px 60px; min-height: 100svh; }
  .hero-visual { display: none; }
  .hero-title { font-size: clamp(1.5rem, 7vw, 2.4rem); height: auto; min-height: 1.4em; }
  .hero-greeting { font-size: 1rem; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-avatar { display: flex; flex-direction: column; align-items: center; }
  .avatar-ring { width: 120px; height: 120px; }
  .avatar-inner { font-size: 1.5rem; }
  .about-text p { font-size: .95rem; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; gap: 16px; }
  .project-card { padding: 24px; }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; gap: 16px; }
  .skill-group { padding: 20px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form { padding: 20px; }
  .contact-email { font-size: .9rem; word-break: break-all; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }

  /* Touch targets */
  .btn { padding: 14px 24px; font-size: 1rem; }
  .social-link { width: 48px; height: 48px; }
  .mobile-link { padding: 14px 0; font-size: 1.05rem; }
}

@media (max-width: 400px) {
  .hero-title { font-size: 1.4rem; }
  .project-card { padding: 18px; }
  .contact-form { padding: 16px; }
}
