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

:root {
  --bg:        #050810;
  --bg2:       #090d1a;
  --surface:   rgba(255,255,255,0.04);
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.14);
  --text:      #e8eaf6;
  --muted:     #7b82a8;
  --accent:    #6c63ff;
  --accent2:   #a78bfa;
  --cyan:      #22d3ee;
  --green:     #10b981;
  --pink:      #f472b6;
  --yellow:    #fbbf24;
  --r:         12px;
  --r2:        20px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: rgba(108,99,255,0.35); color: #fff; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; margin-bottom: 1rem; }
h2 em { font-style: normal; background: linear-gradient(135deg, var(--accent), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
p { color: var(--muted); max-width: 60ch; }

/* ── LAYOUT ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 2rem; }
section { padding: 6rem 0; position: relative; }
.section-label { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--accent2); letter-spacing: .15em; text-transform: uppercase; margin-bottom: 1rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.75rem; border-radius: 99px; font-size: .95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none; transition: all .25s;
  font-family: 'Space Grotesk', sans-serif;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 0 24px rgba(108,99,255,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(108,99,255,.55); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border2); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: var(--border); border-color: var(--accent); transform: translateY(-2px); }
.btn-full { width: 100%; justify-content: center; border-radius: var(--r); padding: 1rem; }

/* ── NAV ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.1rem 2rem;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
}
#nav.scrolled {
  background: rgba(5,8,16,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 2rem; }
.nav-logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -.04em; color: #fff; margin-right: auto; }
.dot { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav-cta { padding: .55rem 1.4rem; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
}

/* ── HERO ── */
#hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden; padding: 0 2rem;
  gap: 3rem;
}
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .45; }

.hero-content { position: relative; z-index: 2; flex: 1; max-width: 600px; padding-top: 5rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25);
  color: var(--green); padding: .35rem .9rem; border-radius: 99px;
  font-size: .8rem; font-weight: 500; margin-bottom: 1.5rem;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

.hero-greeting { font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 400; color: var(--muted); display: block; margin-bottom: .25rem; }
.hero-name { font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 700; color: #fff; display: block; letter-spacing: -.04em; background: linear-gradient(135deg, #fff 60%, var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.hero-tagline { font-family: 'JetBrains Mono', monospace; font-size: clamp(.95rem, 1.5vw, 1.2rem); color: var(--accent2); margin: 1rem 0 1.25rem; max-width: none; }
.typed-wrapper { display: inline-flex; align-items: center; gap: 2px; }
.cursor { animation: blink 1s step-end infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { font-size: 1.05rem; line-height: 1.75; color: var(--muted); margin-bottom: 2rem; max-width: 50ch; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-scroll { position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; animation: fadeInUp 1s 1.5s both; }
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, transparent, var(--accent)); }

.hero-visual { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; z-index: 2; padding-top: 5rem; }
@media (max-width: 900px) { .hero-visual { display: none; } }

.glow-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.orb1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(108,99,255,.25), transparent 70%); top: -100px; right: -100px; }
.orb2 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(34,211,238,.15), transparent 70%); bottom: 0; right: 100px; }

.code-window {
  background: rgba(9,13,26,.9); border: 1px solid var(--border2);
  border-radius: var(--r2); overflow: hidden; width: 440px;
  box-shadow: 0 0 80px rgba(108,99,255,.2), 0 40px 60px rgba(0,0,0,.5);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.code-header {
  background: rgba(255,255,255,.04); padding: .75rem 1rem;
  display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid var(--border);
}
.dot-r { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dot-y { width: 10px; height: 10px; border-radius: 50%; background: #febc2e; }
.dot-g { width: 10px; height: 10px; border-radius: 50%; background: #28c840; }
.code-title { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--muted); margin-left: auto; }

.code-body { padding: 1.25rem 1.5rem; font-family: 'JetBrains Mono', monospace; font-size: .78rem; line-height: 1.85; overflow-x: auto; }
.code-body code { display: block; }
.kw  { color: #c792ea; }
.cls { color: var(--cyan); }
.fn  { color: #82aaff; }
.str { color: var(--green); }
.num { color: var(--yellow); }
.op  { color: #89ddff; }
.cm  { color: #546e7a; }

/* ── HERO AVATAR ── */
.hero-avatar {
  width: 250px; height: 250px; border-radius: 50%; margin-bottom: 2rem;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--cyan), var(--pink));
  box-shadow: 0 0 50px rgba(108,99,255,.6), 0 0 100px rgba(34,211,238,.2), 0 20px 50px rgba(0,0,0,.4);
  animation: fadeInUp .8s both;
  flex-shrink: 0;
}
.hero-avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: top center;
  border: 4px solid var(--bg);
}

/* ── ABOUT ── */
#about { background: var(--bg2); }
.about-grid { display: grid; grid-template-columns: 440px 1fr 1fr; gap: 4rem; align-items: start; }
@media (max-width: 1200px) { .about-grid { grid-template-columns: 380px 1fr; gap: 3rem; } }
@media (max-width: 800px)  { .about-grid { grid-template-columns: 1fr; gap: 3rem; } }

/* ── Profile photo ── */
.about-photo-col { display: flex; justify-content: center; }

.profile-frame {
  position: relative;
  width: 400px; height: 460px;
  flex-shrink: 0;
}

/* subtle glow blob behind photo */
.profile-frame::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at 50% 40%, rgba(108,99,255,.35) 0%, rgba(34,211,238,.1) 50%, transparent 75%);
  border-radius: 50%;
  filter: blur(30px);
  z-index: 0;
}

.profile-photo {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  object-fit: cover; object-position: top center;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg2), var(--bg2)) padding-box,
              linear-gradient(160deg, var(--accent), var(--cyan), var(--pink)) border-box;
  box-shadow:
    0 0 0 1px rgba(108,99,255,.2),
    0 0 40px rgba(108,99,255,.35),
    0 0 80px rgba(108,99,255,.15),
    0 30px 60px rgba(0,0,0,.5);
  animation: morphShape 10s ease-in-out infinite;
}

@keyframes morphShape {
  0%,100% { border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%; }
  25%      { border-radius: 55% 45% 40% 60% / 60% 55% 45% 40%; }
  50%      { border-radius: 50% 50% 45% 55% / 40% 60% 40% 60%; }
  75%      { border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%; }
}

/* spinning accent ring */
.profile-ring {
  position: absolute; z-index: 2;
  inset: -14px; border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(108,99,255,.0) 50%,
    rgba(108,99,255,.8) 75%,
    rgba(34,211,238,.9) 85%,
    rgba(167,139,250,.6) 92%,
    transparent 100%
  );
  animation: spinSlow 8s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
}

/* decorative floating dots */
.profile-frame::after {
  content: '';
  position: absolute; z-index: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  top: 10%; right: -20px;
  animation: floatDot 4s ease-in-out infinite;
}

@keyframes floatDot {
  0%,100% { transform: translateY(0) scale(1); opacity: .9; }
  50%      { transform: translateY(-14px) scale(1.2); opacity: 1; }
}

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

.about-text h2 { margin-bottom: 1.25rem; }
.about-text p { margin-bottom: 1rem; line-height: 1.8; }

.about-stats { display: flex; gap: 2.5rem; margin-top: 2rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat-num { font-size: 2.2rem; font-weight: 700; background: linear-gradient(135deg, var(--accent), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: .8rem; color: var(--muted); letter-spacing: .05em; }

.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 1.5rem; transition: all .3s; cursor: default;
}
.about-card:hover { border-color: var(--accent); background: rgba(108,99,255,.06); transform: translateY(-4px); }
.card-icon { font-size: 1.75rem; margin-bottom: .75rem; }
.about-card h3 { font-size: 1rem; margin-bottom: .5rem; color: #fff; }
.about-card p { font-size: .85rem; line-height: 1.6; max-width: none; }

/* ── SKILLS ── */
#skills { position: relative; overflow: hidden; }
#skills::before { content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(108,99,255,.08), transparent 70%); pointer-events: none; }

.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 3rem; }
@media (max-width: 640px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 1.75rem; }
.skill-group-title { font-size: .75rem; font-family: 'JetBrains Mono', monospace; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag {
  font-size: .8rem; font-weight: 500; padding: .3rem .8rem; border-radius: 99px;
  border: 1px solid; transition: transform .2s;
}
.tag:hover { transform: translateY(-2px); }
.tag-ai    { color: var(--accent2); border-color: rgba(167,139,250,.25); background: rgba(167,139,250,.07); }
.tag-lang  { color: var(--cyan);    border-color: rgba(34,211,238,.25);  background: rgba(34,211,238,.07);  }
.tag-web   { color: var(--pink);    border-color: rgba(244,114,182,.25); background: rgba(244,114,182,.07); }
.tag-cloud { color: var(--yellow);  border-color: rgba(251,191,36,.25);  background: rgba(251,191,36,.07);  }

/* ── PROJECTS ── */
#projects { background: var(--bg2); }
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 3rem; }
@media (max-width: 700px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2);
  overflow: hidden; transition: all .35s; display: flex; flex-direction: column;
}
.project-card:hover { border-color: var(--border2); transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.project-card.featured { grid-column: 1 / -1; flex-direction: row; }
@media (max-width: 700px) { .project-card.featured { flex-direction: column; } }

.project-img { height: 180px; overflow: hidden; flex-shrink: 0; }
.project-card.featured .project-img { width: 300px; height: auto; min-height: 220px; }

.project-visual { width: 100%; height: 100%; }
.pv1 { background: linear-gradient(135deg, #1a0533, #3b1688, #6c63ff, #22d3ee); background-size: 200% 200%; animation: gradShift 8s ease infinite; }
.pv2 { background: linear-gradient(135deg, #051a14, #065f46, #10b981, #34d399); background-size: 200% 200%; animation: gradShift 8s ease 2s infinite; }
.pv3 { background: linear-gradient(135deg, #1a0520, #7c2d72, #f472b6, #fb923c); background-size: 200% 200%; animation: gradShift 8s ease 4s infinite; }
.pv4 { background: linear-gradient(135deg, #1c1a00, #78350f, #fbbf24, #f97316); background-size: 200% 200%; animation: gradShift 8s ease 6s infinite; }
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.project-body { padding: 1.75rem; flex: 1; }
.project-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.project-tag { font-size: .72rem; font-weight: 600; color: var(--accent2); background: rgba(167,139,250,.1); border: 1px solid rgba(167,139,250,.2); padding: .2rem .65rem; border-radius: 99px; }
.project-card h3 { font-size: 1.15rem; color: #fff; margin-bottom: .6rem; }
.project-card p { font-size: .88rem; line-height: 1.7; max-width: none; }
.project-links { display: flex; gap: 1rem; margin-top: 1.25rem; }
.proj-link { font-size: .85rem; font-weight: 600; color: var(--accent2); text-decoration: none; transition: color .2s; }
.proj-link:hover { color: var(--cyan); }
.proj-link-ghost { color: var(--muted); }
.proj-link-ghost:hover { color: #fff; }

/* ── CONTACT ── */
#contact {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  position: relative; overflow: hidden;
}
#contact::after { content: ''; position: absolute; bottom: -200px; right: -200px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(108,99,255,.1), transparent 70%); pointer-events: none; }

.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
@media (max-width: 800px) { .contact-inner { grid-template-columns: 1fr; gap: 3rem; } }

.contact-text h2 { margin-bottom: 1rem; }
.contact-text > p { margin-bottom: 2rem; }
.contact-details { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 2rem; }
.contact-item { display: flex; align-items: center; gap: .85rem; color: var(--muted); text-decoration: none; font-size: .95rem; transition: color .2s; }
.contact-item:hover { color: var(--accent2); }
.contact-icon { font-size: 1.1rem; color: var(--accent); width: 1.5rem; text-align: center; }

.social-links { display: flex; gap: .75rem; }
.social-link {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  text-decoration: none; transition: all .25s;
}
.social-link:hover { background: rgba(108,99,255,.15); border-color: var(--accent); color: var(--accent2); transform: translateY(-3px); }

/* ── FORM ── */
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .82rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.form-group input,
.form-group textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: .75rem 1rem; color: var(--text); font-family: 'Space Grotesk', sans-serif; font-size: .95rem;
  outline: none; transition: border-color .2s, box-shadow .2s; resize: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(123,130,168,.5); }
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,.15); }

.form-success {
  text-align: center; padding: .85rem; border-radius: var(--r);
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25);
  color: var(--green); font-size: .9rem;
}
.hidden { display: none; }

/* ── FOOTER ── */
footer { padding: 2rem 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer p { font-size: .82rem; max-width: none; }
.back-top { font-size: .82rem; color: var(--muted); text-decoration: none; transition: color .2s; }
.back-top:hover { color: var(--accent2); }

/* ── ANIMATIONS ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }
