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

:root {
  --bg: #0d0d18;
  --bg-alt: #12121f;
  --surface: rgba(255,255,255,0.04);
  --surface-hov: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.1);
  --text: #f0f4ff;
  --muted: #9aa5bf;
  --accent: #6c63ff;
  --accent2: #3ecfcf;
  --accent-glow: rgba(108,99,255,0.35);
  --red: #ff4f6d;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-head: 'Poppins', 'Segoe UI', sans-serif;
  --nav-h: 64px;
}

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

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

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6vw;
  backdrop-filter: blur(14px);
  background: rgba(13,13,24,0.75);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav.scrolled { background: rgba(13,13,24,0.95); }

.nav-brand {
  font-family: var(--font-head); font-weight: 900; font-size: 1.5rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.02em;
}
.nav-brand .dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 0.3rem; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.9rem;
  padding: 0.4rem 0.75rem; border-radius: 8px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hov); }
.nav-links .nav-cta {
  background: var(--accent); color: #fff; padding: 0.4rem 1rem; border-radius: 8px;
}
.nav-links .nav-cta:hover { background: #7b74ff; color: #fff; }

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

/* ── HERO ── */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 3rem) 6vw 4rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 40%, rgba(108,99,255,0.2) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(62,207,207,0.14) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content { max-width: 600px; z-index: 1; }

.hero-greeting { font-size: 1.15rem; font-weight: 600; color: var(--muted); margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%,30%{transform:rotate(22deg)} 20%{transform:rotate(-6deg)} 40%{transform:rotate(16deg)} 50%{transform:rotate(-2deg)} }

.hero-name {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.08; letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.accent-text {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.hero-role { font-size: 1.25rem; font-weight: 500; color: var(--muted); margin-bottom: 1rem; min-height: 2rem; }
.role-prefix { color: var(--muted); }
.typed-text { color: var(--text); font-weight: 600; }
.cursor { display: inline-block; color: var(--accent); animation: blink 0.9s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-bio { color: var(--muted); max-width: 50ch; margin-bottom: 1.8rem; font-size: 0.97rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.8rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.5rem; border-radius: 10px; font-weight: 600; font-size: 0.93rem;
  text-decoration: none; transition: all 0.22s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:hover { background: #7b74ff; transform: translateY(-2px); box-shadow: 0 8px 28px var(--accent-glow); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.08); }

.hero-socials { display: flex; gap: 0.75rem; }
.social-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.social-icon:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.1); transform: translateY(-3px); }

/* Avatar */
.hero-avatar-wrap {
  position: relative; flex-shrink: 0;
  width: clamp(230px, 28vw, 340px);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  z-index: 1;
}
.avatar-ring {
  position: absolute; inset: -12px;
  border-radius: 50%;
  border: 2px dashed rgba(108,99,255,0.4);
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-img {
  width: 100%; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}
.avatar-img img,
.avatar-img svg { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center; }

.avatar-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 999px;
  border: 1px solid rgba(62,207,207,0.4);
  background: rgba(62,207,207,0.08);
  color: var(--accent2); font-size: 0.85rem; font-weight: 600;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecfcf; box-shadow: 0 0 6px #3ecfcf; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.4)} }

.hero-scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  color: var(--muted); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(6px)} }

/* ── SECTIONS ── */
.section { padding: 6rem 6vw; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: 1080px; margin: 0 auto; }

.section-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
}
.section-title {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -0.02em; margin-bottom: 2.5rem; line-height: 1.15;
}

/* ── ABOUT ── */
.about-grid { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 1rem; }
.about-text strong { color: var(--text); }

.about-details { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.5rem; }
.detail-item { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.93rem; color: var(--muted); }
.detail-item svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }

.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.stat-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.2rem 1rem; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  text-align: center; min-width: 90px;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.stat-num { font-family: var(--font-head); font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-top: 0.15rem; }

/* ── SKILLS ── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.skill-group {
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.5rem; background: var(--surface);
  transition: border-color 0.2s;
}
.skill-group:hover { border-color: var(--accent); }
.skill-group-title {
  font-family: var(--font-head); font-size: 1rem; font-weight: 700;
  color: var(--accent2); margin-bottom: 1rem;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  padding: 0.35rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.08); }

/* ── PROJECTS ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.project-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 18px;
  padding: 1.4rem; background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(108,99,255,0.07) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 16px 40px rgba(108,99,255,0.18); }
.project-card:hover::before { opacity: 1; }

.project-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.project-icon { font-size: 1.8rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.ptag {
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 6px;
  background: rgba(108,99,255,0.15); color: var(--accent); border: 1px solid rgba(108,99,255,0.25);
}
.project-name { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; margin-bottom: 0.5rem; }
.project-desc { color: var(--muted); font-size: 0.88rem; flex: 1; margin-bottom: 1rem; }
.project-link { color: var(--accent2); font-weight: 700; font-size: 0.88rem; margin-top: auto; }

/* ── TIMELINE / EDUCATION ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--accent), var(--accent2)); border-radius: 2px; }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-dot {
  position: absolute; left: -2.5rem; width: 14px; height: 14px; top: 4px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-alt);
  box-shadow: 0 0 10px var(--accent-glow);
}
.timeline-content {
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.4rem; background: var(--surface); margin-left: 0.5rem;
}
.timeline-year {
  display: inline-block; margin-bottom: 0.5rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(108,99,255,0.3); border-radius: 6px;
  padding: 0.2rem 0.6rem; background: rgba(108,99,255,0.08);
}
.timeline-content h3 { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.timeline-content p { color: var(--muted); font-size: 0.92rem; }

/* ── CONTACT ── */
.contact-section {
  background:
    radial-gradient(circle at 50% 0%, rgba(108,99,255,0.2) 0%, transparent 55%),
    var(--bg);
}
.contact-inner { text-align: center; }
.contact-sub { color: var(--muted); max-width: 54ch; margin: 0 auto 2.5rem; font-size: 0.97rem; }
.contact-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.contact-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.5rem 1.4rem; border-radius: 16px; min-width: 150px;
  border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(108,99,255,0.18); }
.cc-icon {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.25rem;
}
.email-icon    { background: rgba(255,79,109,0.12); color: #ff4f6d; }
.github-icon   { background: rgba(240,240,240,0.1); color: #f0f0f0; }
.linkedin-icon { background: rgba(0,119,255,0.12); color: #4b9eff; }
.fb-icon       { background: rgba(24,119,242,0.12); color: #5b9bf8; }
.cc-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cc-value { font-size: 0.88rem; font-weight: 600; color: var(--text); }

.quick-mail {
  margin: 0;
  max-width: 760px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
}

.quick-mail h3 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.quick-mail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.quick-mail input,
.quick-mail textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  margin-top: 0.7rem;
}

.quick-mail input:focus,
.quick-mail textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.quick-mail button {
  margin-top: 0.8rem;
}

.open-mail-modal {
  margin: 2rem auto 0;
}

.mail-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 8, 20, 0.72);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.mail-modal.show {
  display: flex;
}

.mail-modal-card {
  width: min(640px, 96vw);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #121827;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  padding: 1.1rem;
  position: relative;
}

.mail-modal-card h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.mail-modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.mail-modal-close:hover {
  background: rgba(255, 255, 255, 0.13);
}

.mail-status {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.2em;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 260;
  max-width: min(420px, 92vw);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 39, 0.95);
  color: var(--text);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 79, 109, 0.55);
}

.toast.success {
  border-color: rgba(62, 207, 207, 0.55);
}

.nav-links a.active { color: var(--text); background: var(--surface-hov); }

/* ── FOOTER ── */
.footer {
  text-align: center; padding: 1.5rem; font-size: 0.85rem; color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 600;
}

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

/* ── REVEAL ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── MOBILE ── */
@media (max-width: 900px) {
  .hero { flex-direction: column-reverse; align-items: center; text-align: center; padding-top: calc(var(--nav-h) + 2rem); }
  .hero-content { max-width: 100%; }
  .hero-actions, .hero-socials, .hero-greeting { justify-content: center; }
  .hero-avatar-wrap { width: clamp(180px, 50vw, 240px); }
  .about-grid { grid-template-columns: 1fr; }
  .about-cards { grid-template-columns: repeat(4,1fr); }
  .quick-mail-grid { grid-template-columns: 1fr; }
  .hero-scroll-hint { display: none; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: fixed; top: var(--nav-h); left: 0; right: 0; padding: 1.5rem 6vw; background: rgba(13,13,24,0.97); border-bottom: 1px solid var(--border); gap: 0.25rem; }
  .nav-links.open { display: flex; }
  .nav-links .nav-cta { width: fit-content; }
  .nav-toggle { display: flex; }
  .about-cards { grid-template-columns: repeat(2,1fr); }
  .section { padding: 4rem 5vw; }
}
