/* ============ Tokens ============ */
:root{
  --bg: #08080f;
  --bg-alt: #0d0d18;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.1);
  --text: #eaeaf4;
  --text-dim: #9494ad;
  --blue: #5b7cfa;
  --purple: #9b5cf6;
  --grad: linear-gradient(135deg, var(--blue), var(--purple));
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Sora', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --ease: cubic-bezier(.16,1,.3,1);
}

*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  line-height:1.6;
  overflow-x:hidden;
  cursor:none;
}
a{color:inherit;text-decoration:none;}
ul{list-style:none;}
img{max-width:100%;display:block;}
button{font-family:inherit;cursor:none;border:none;background:none;color:inherit;}
::selection{background:var(--purple);color:#fff;}

@media (hover:none){ body,button{cursor:auto;} }

/* ============ Loader ============ */
.loader{
  position:fixed;inset:0;background:var(--bg);
  display:flex;align-items:center;justify-content:center;
  z-index:9999;transition:opacity .6s var(--ease), visibility .6s var(--ease);
}
.loader.hidden{opacity:0;visibility:hidden;}
.loader-code{font-family:var(--font-mono);font-size:clamp(1.4rem,4vw,2.2rem);color:var(--text-dim);letter-spacing:1px;}
.loader-name{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;margin:0 .3rem;}

/* ============ Custom Cursor ============ */
.cursor-dot,.cursor-ring{position:fixed;top:0;left:0;pointer-events:none;z-index:9998;border-radius:50%;transform:translate(-50%,-50%);}
.cursor-dot{width:6px;height:6px;background:var(--blue);}
.cursor-ring{width:32px;height:32px;border:1px solid var(--purple);transition:width .2s,height .2s,border-color .2s;}
.cursor-ring.grow{width:56px;height:56px;border-color:var(--blue);}
@media (hover:none){ .cursor-dot,.cursor-ring{display:none;} }

/* ============ Scroll Progress ============ */
.scroll-progress{position:fixed;top:0;left:0;height:3px;background:var(--grad);z-index:9997;width:0%;}

/* ============ Particles ============ */
#particles{position:fixed;inset:0;z-index:0;opacity:.5;}

/* ============ Navbar ============ */
.navbar{
  position:fixed;top:0;left:0;right:0;z-index:1000;
  padding:1.2rem 0;transition:all .4s var(--ease);
}
.navbar.scrolled{
  padding:.8rem 0;background:rgba(8,8,15,.75);backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
}
.nav-inner{max-width:1200px;margin:0 auto;padding:0 2rem;display:flex;align-items:center;justify-content:space-between;}
.logo{font-family:var(--font-display);font-size:1.4rem;font-weight:700;}
.logo .dot{color:var(--purple);}
.nav-links{display:flex;gap:1.8rem;}
.nav-link{font-size:.9rem;color:var(--text-dim);position:relative;padding:.3rem 0;transition:color .3s;}
.nav-link::after{content:'';position:absolute;left:0;bottom:0;width:0;height:1px;background:var(--grad);transition:width .3s var(--ease);}
.nav-link:hover,.nav-link.active{color:var(--text);}
.nav-link.active::after{width:100%;}
.nav-toggle{display:none;flex-direction:column;gap:5px;width:26px;}
.nav-toggle span{height:2px;background:var(--text);border-radius:2px;transition:.3s;}

/* ============ Layout Helpers ============ */
.container{max-width:1200px;margin:0 auto;padding:0 2rem;position:relative;z-index:1;}
.section{padding:8rem 0;position:relative;z-index:1;}
.section-eyebrow{font-family:var(--font-mono);font-size:.85rem;color:var(--blue);margin-bottom:.8rem;letter-spacing:.05em;}
.section-title{font-family:var(--font-display);font-size:clamp(2rem,4vw,2.8rem);font-weight:600;margin-bottom:3rem;}
.gradient-text{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;}

/* ============ Reveal ============ */
.reveal{opacity:0;transform:translateY(40px);transition:opacity .8s var(--ease),transform .8s var(--ease);}
.reveal.in{opacity:1;transform:translateY(0);}

/* ============ Hero ============ */
.hero{
  min-height:100vh;display:flex;align-items:center;position:relative;
  padding:8rem 2rem 4rem;
}
.hero-inner{
  max-width:1200px;margin:0 auto;width:100%;
  display:grid;grid-template-columns:1.2fr .8fr;gap:3rem;align-items:center;
  position:relative;z-index:1;
}
.hero-eyebrow{font-family:var(--font-mono);color:var(--purple);font-size:.9rem;margin-bottom:1rem;}
.hero-title{font-family:var(--font-display);font-size:clamp(2.4rem,5.5vw,4.2rem);font-weight:700;line-height:1.1;margin-bottom:1rem;}
.hero-typed{font-family:var(--font-mono);font-size:clamp(1rem,2vw,1.3rem);color:var(--text-dim);min-height:2rem;margin-bottom:1.4rem;}
.cursor-blink{animation:blink 1s step-end infinite;color:var(--blue);}
@keyframes blink{50%{opacity:0;}}
.hero-desc{color:var(--text-dim);max-width:480px;margin-bottom:2rem;font-size:1.02rem;}
.hero-actions{display:flex;gap:1rem;margin-bottom:2.4rem;flex-wrap:wrap;}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:.9rem 1.8rem;border-radius:50px;font-weight:500;font-size:.95rem;
  transition:transform .3s var(--ease),box-shadow .3s var(--ease);position:relative;overflow:hidden;
}
.btn-primary{background:var(--grad);color:#fff;}
.btn-primary:hover{transform:translateY(-3px);box-shadow:0 10px 30px -8px rgba(91,124,250,.6);}
.btn-outline{border:1px solid var(--border);color:var(--text);}
.btn-outline:hover{border-color:var(--purple);transform:translateY(-3px);}
.btn.full{width:100%;}
.hero-socials{display:flex;gap:1rem;}
.hero-socials a{
  width:42px;height:42px;border:1px solid var(--border);border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:.75rem;
  transition:.3s;
}
.hero-socials a:hover{border-color:var(--blue);color:var(--blue);transform:translateY(-3px);}

.hero-photo-wrap{position:relative;width:min(340px,80%);margin:0 auto;}
.hero-photo-glow{
  position:absolute;inset:-20px;background:var(--grad);border-radius:32px;
  filter:blur(50px);opacity:.35;animation:pulse-glow 4s ease-in-out infinite;
}
@keyframes pulse-glow{50%{opacity:.55;}}
.hero-photo{
  position:relative;width:100%;aspect-ratio:1/1.1;object-fit:cover;
  border-radius:28px;border:1px solid var(--border);
  box-shadow:0 30px 60px -20px rgba(0,0,0,.6);
}

.scroll-cue{position:absolute;bottom:2rem;left:50%;transform:translateX(-50%);z-index:1;}
.scroll-cue span{
  display:block;width:22px;height:36px;border:1px solid var(--border);border-radius:20px;position:relative;
}
.scroll-cue span::before{
  content:'';position:absolute;top:6px;left:50%;transform:translateX(-50%);
  width:4px;height:8px;background:var(--blue);border-radius:2px;
  animation:scroll-cue 1.6s ease-in-out infinite;
}
@keyframes scroll-cue{50%{transform:translate(-50%,10px);opacity:0;}}

/* ============ About ============ */
.about-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:3rem;align-items:start;}
.about-text{color:var(--text-dim);font-size:1.05rem;}
.about-facts{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
.fact-card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:1.2rem;transition:.3s;
}
.fact-card:hover{background:var(--surface-strong);transform:translateY(-4px);}
.fact-card span{display:block;font-size:.78rem;color:var(--text-dim);margin-bottom:.4rem;}
.fact-card strong{font-family:var(--font-display);font-size:1rem;}
.interests{display:flex;flex-wrap:wrap;gap:.7rem;margin-top:2.4rem;}
.chip{
  padding:.5rem 1.1rem;border:1px solid var(--border);border-radius:50px;font-size:.85rem;color:var(--text-dim);
  transition:.3s;
}
.chip:hover{border-color:var(--purple);color:var(--text);}

/* ============ Timeline ============ */
.timeline{position:relative;padding-left:2rem;border-left:1px solid var(--border);}
.timeline-item{position:relative;padding-bottom:3rem;padding-left:2rem;}
.timeline-item:last-child{padding-bottom:0;}
.timeline-dot{
  position:absolute;left:-2.45rem;top:.3rem;width:10px;height:10px;border-radius:50%;
  background:var(--grad);box-shadow:0 0 0 4px var(--bg),0 0 0 5px var(--border);
}
.timeline-date{font-family:var(--font-mono);font-size:.8rem;color:var(--blue);}
.timeline-content h3{font-family:var(--font-display);font-size:1.3rem;margin:.5rem 0 .2rem;}
.timeline-content p{color:var(--text-dim);margin-bottom:.8rem;}
.timeline-list{display:flex;flex-wrap:wrap;gap:.6rem;}
.timeline-list li{
  font-size:.82rem;color:var(--text-dim);background:var(--surface);border:1px solid var(--border);
  padding:.35rem .8rem;border-radius:8px;
}

/* ============ Skills ============ */
.skills-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2.5rem;}
.skill-group h3{font-family:var(--font-display);margin-bottom:1.4rem;font-size:1.1rem;}
.skill-bar{margin-bottom:1.2rem;}
.skill-info{display:flex;justify-content:space-between;font-size:.85rem;margin-bottom:.5rem;color:var(--text-dim);}
.bar{height:6px;background:var(--surface);border-radius:10px;overflow:hidden;}
.bar-fill{height:100%;width:0;border-radius:10px;background:var(--grad);transition:width 1.4s var(--ease);}

/* ============ Experience ============ */
.exp-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:2rem;}
.exp-head{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:1rem;margin-bottom:1rem;}
.exp-head h3{font-family:var(--font-display);font-size:1.2rem;}
.exp-head p{color:var(--text-dim);}

/* ============ Projects ============ */
.projects-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:2rem;}
.project-card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;
  transition:.4s var(--ease);
}
.project-card:hover{transform:translateY(-8px);border-color:var(--purple);box-shadow:0 20px 40px -20px rgba(155,92,246,.4);}
.project-shot{
  height:180px;display:flex;align-items:center;justify-content:center;
  font-family:var(--font-display);font-size:1.4rem;color:var(--text-dim);
  background:linear-gradient(135deg,rgba(91,124,250,.15),rgba(155,92,246,.15));
}
.project-body{padding:1.6rem;}
.project-body h3{font-family:var(--font-display);margin-bottom:.6rem;}
.project-body p{color:var(--text-dim);font-size:.92rem;margin-bottom:1rem;}
.project-tags{display:flex;gap:.5rem;margin-bottom:1.2rem;}
.project-tags span{font-size:.75rem;font-family:var(--font-mono);color:var(--blue);border:1px solid var(--border);padding:.25rem .6rem;border-radius:6px;}
.project-links a{font-size:.88rem;color:var(--purple);font-weight:500;}
.project-links a:hover{text-decoration:underline;}

/* ============ Certificates ============ */
.certs-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem;}
.cert-card.placeholder{
  border:1px dashed var(--border);border-radius:var(--radius);height:160px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6rem;
  color:var(--text-dim);transition:.3s;
}
.cert-card.placeholder span{font-size:1.6rem;color:var(--blue);}
.cert-card.placeholder:hover{border-color:var(--purple);color:var(--text);}

/* ============ Services ============ */
.services-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1.5rem;}
.service-card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.8rem;
  transition:.3s;
}
.service-card:hover{background:var(--surface-strong);transform:translateY(-6px);}
.service-card h3{font-family:var(--font-display);font-size:1.05rem;margin-bottom:.6rem;}
.service-card p{color:var(--text-dim);font-size:.88rem;}

/* ============ Stats ============ */
.stats-section{padding:5rem 0;}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1.5rem;text-align:center;}
.stat-card{padding:2rem 1rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);}
.stat-num{display:block;font-family:var(--font-display);font-size:2.4rem;font-weight:700;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;}
.stat-card p{color:var(--text-dim);margin-top:.4rem;font-size:.9rem;}

/* ============ Testimonials ============ */
.testimonials-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem;}
.testimonial-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.8rem;}
.testimonial-card p{color:var(--text-dim);font-style:italic;margin-bottom:1.2rem;font-size:.92rem;}
.testimonial-author strong{display:block;font-family:var(--font-display);font-size:.95rem;}
.testimonial-author span{font-size:.8rem;color:var(--text-dim);}

/* ============ Contact ============ */
.contact-grid{display:grid;grid-template-columns:1.3fr .7fr;gap:3rem;}
.contact-form{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:2rem;}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:1.2rem;}
.form-field{position:relative;margin-bottom:1.4rem;}
.form-field input,.form-field textarea{
  width:100%;background:var(--bg-alt);border:1px solid var(--border);border-radius:10px;
  padding:1rem;color:var(--text);font-family:var(--font-body);font-size:.95rem;transition:.3s;resize:vertical;
}
.form-field input:focus,.form-field textarea:focus{outline:none;border-color:var(--blue);}
.form-field label{
  position:absolute;left:1rem;top:1rem;color:var(--text-dim);font-size:.95rem;
  pointer-events:none;transition:.2s var(--ease);background:transparent;
}
.form-field input:focus + label,.form-field input:not(:placeholder-shown) + label,
.form-field textarea:focus + label,.form-field textarea:not(:placeholder-shown) + label{
  top:-.6rem;left:.7rem;font-size:.72rem;background:var(--bg);padding:0 .4rem;color:var(--blue);
}
.form-field.invalid input,.form-field.invalid textarea{border-color:#f45b69;}
.error-msg{display:block;font-size:.75rem;color:#f45b69;margin-top:.3rem;min-height:1em;}
.form-success{
  display:none;margin-top:1rem;font-size:.9rem;color:#5be89b;text-align:center;
}
.form-success.show{display:block;}

.contact-info{display:flex;flex-direction:column;gap:1.4rem;}
.info-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.2rem;}
.info-item span{display:block;font-size:.78rem;color:var(--text-dim);margin-bottom:.3rem;}
.info-item a,.info-item p{font-family:var(--font-display);font-size:1rem;}
.map-placeholder{
  height:160px;border:1px dashed var(--border);border-radius:var(--radius);
  display:flex;align-items:center;justify-content:center;color:var(--text-dim);font-size:.85rem;
}

/* ============ Footer ============ */
.footer{border-top:1px solid var(--border);padding:2.5rem 0;position:relative;z-index:1;}
.footer-inner{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1rem;}
.footer-socials{display:flex;gap:1.5rem;}
.footer-socials a{font-size:.85rem;color:var(--text-dim);}
.footer-socials a:hover{color:var(--text);}
.footer-copy{font-size:.8rem;color:var(--text-dim);width:100%;text-align:center;margin-top:1rem;}

.back-to-top{
  position:fixed;bottom:2rem;right:2rem;width:46px;height:46px;border-radius:50%;
  background:var(--grad);color:#fff;display:flex;align-items:center;justify-content:center;
  font-size:1.1rem;z-index:900;opacity:0;visibility:hidden;transform:translateY(10px);
  transition:.4s var(--ease);
}
.back-to-top.show{opacity:1;visibility:visible;transform:translateY(0);}

/* ============ Responsive ============ */
@media (max-width:900px){
  .hero-inner{grid-template-columns:1fr;text-align:center;}
  .hero-socials{justify-content:center;}
  .hero-actions{justify-content:center;}
  .hero-visual{order:-1;}
  .about-grid{grid-template-columns:1fr;}
  .skills-grid{grid-template-columns:1fr;}
  .services-grid{grid-template-columns:1fr 1fr;}
  .testimonials-grid{grid-template-columns:1fr;}
  .certs-grid{grid-template-columns:1fr 1fr;}
  .projects-grid{grid-template-columns:1fr;}
  .contact-grid{grid-template-columns:1fr;}
  .stats-grid{grid-template-columns:1fr 1fr;}
  .nav-links{
    position:fixed;top:0;right:-100%;height:100vh;width:min(320px,80%);
    background:rgba(8,8,15,.97);backdrop-filter:blur(20px);flex-direction:column;
    justify-content:center;align-items:center;gap:2rem;transition:right .4s var(--ease);
    border-left:1px solid var(--border);
  }
  .nav-links.open{right:0;}
  .nav-toggle{display:flex;}
}
@media (max-width:600px){
  .form-row{grid-template-columns:1fr;}
  .services-grid{grid-template-columns:1fr;}
  .certs-grid{grid-template-columns:1fr;}
  .section{padding:5rem 0;}
}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important;}
}
