*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #0f0f1a;
  --bg3: #13131f;
  --card: #16161f;
  --border: #1e1e2e;
  --accent: #7c3aed;
  --accent2: #a78bfa;
  --accent-glow: rgba(124, 58, 237, 0.25);
  --text: #e2e2f0;
  --text2: #8888aa;
  --text3: #5555770;
  --white: #ffffff;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
}

html { scroll-behavior: smooth; }

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

.accent { color: var(--accent2); }

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

/* CONTAINER */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* NAV */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
#navbar.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.4); }

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

.nav-logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  padding-bottom: 2px;
}
.nav-logo::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent2);
  transition: width .2s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  list-style: none;
  flex-direction: column;
  padding: 1rem 2rem 1.5rem;
  gap: .75rem;
  border-top: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  color: var(--text2);
  text-decoration: none;
  font-size: 1rem;
  padding: .4rem 0;
}
.nav-mobile a:hover { color: var(--white); }

/* HERO */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 100px 2rem 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 30%, rgba(124,58,237,.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(167,139,250,.06) 0%, transparent 60%);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-family: 'Fira Code', monospace;
  color: var(--accent2);
  font-size: 1rem;
  margin-bottom: .75rem;
  opacity: 0;
  animation: fadeUp .6s .2s forwards;
}
.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--white);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp .6s .35s forwards;
}
.hero-role {
  font-family: 'Fira Code', monospace;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text2);
  margin-bottom: 1.5rem;
  min-height: 2rem;
  opacity: 0;
  animation: fadeUp .6s .5s forwards;
}
.cursor {
  color: var(--accent2);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 520px;
  color: var(--text2);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp .6s .65s forwards;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .6s .8s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: -20px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  opacity: 0;
  animation: fadeUp .6s 1.2s forwards;
}
.hero-scroll span {
  font-family: 'Fira Code', monospace;
  font-size: .7rem;
  color: var(--text2);
  letter-spacing: 2px;
  text-transform: uppercase;
  writing-mode: vertical-lr;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent2), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: .4; transform: scaleY(.7); }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: #6d28d9;
  box-shadow: 0 0 30px rgba(124,58,237,.5);
  transform: translateY(-2px);
}
.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  transform: translateY(-2px);
}

/* SECTIONS */
section { padding: 100px 0; }

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 3rem;
  position: relative;
  padding-left: 1.25rem;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 70%;
  background: var(--accent);
  border-radius: 2px;
}

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

.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  align-items: center;
}
.about-avatar {
  display: flex;
  justify-content: center;
}
.avatar-ring {
  width: 220px; height: 220px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 40px var(--accent-glow);
}
.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.about-text p {
  color: var(--text2);
  margin-bottom: 1rem;
  font-size: 1.02rem;
}
.about-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent2);
  line-height: 1;
}
.stat-label {
  font-size: .8rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* EXPERIENCE */
#experience { background: var(--bg); }

.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1.95rem; top: 1.4rem;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 10px var(--accent-glow);
}
.timeline-dot--active {
  background: var(--green);
  box-shadow: 0 0 12px rgba(16,185,129,.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(16,185,129,.5); }
  50% { box-shadow: 0 0 22px rgba(16,185,129,.9); }
}
.timeline-badge--active {
  background: rgba(16,185,129,.12);
  color: var(--green);
}

.timeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color .2s, box-shadow .2s;
}
.timeline-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .5rem;
}
.timeline-role {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
}
.timeline-company {
  font-size: .88rem;
  color: var(--accent2);
  margin-top: .15rem;
}
.timeline-badge {
  font-family: 'Fira Code', monospace;
  font-size: .7rem;
  padding: .2rem .65rem;
  background: rgba(124,58,237,.12);
  color: var(--accent2);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.timeline-date {
  font-size: .8rem;
  color: var(--text2);
  margin-bottom: .75rem;
  font-family: 'Fira Code', monospace;
}
.timeline-desc {
  font-size: .87rem;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: .75rem;
}
.timeline-tags { display: flex; gap: .5rem; flex-wrap: wrap; }

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

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.skill-icon {
  width: 40px; height: 40px;
  margin-bottom: 1rem;
}
.skill-icon svg { width: 100%; height: 100%; }
.skill-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: .4rem;
}
.skill-card p {
  font-size: .82rem;
  color: var(--text2);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.skill-bar {
  height: 4px;
  background: var(--border);
  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 ease;
}
.skill-fill.animated { transform: scaleX(1); }

/* PROJECTS */
#projects { background: var(--bg2); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.project-preview {
  height: 130px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
.project-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.03) 0px,
    rgba(255,255,255,.03) 1px,
    transparent 1px,
    transparent 12px
  );
}
.preview-label {
  font-family: 'Fira Code', monospace;
  font-size: .75rem;
  color: rgba(255,255,255,.6);
  letter-spacing: 1px;
  z-index: 1;
}
.project-preview--img {
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.project-preview--img::before { display: none; }

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 12px 40px var(--accent-glow);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-lang {
  font-family: 'Fira Code', monospace;
  font-size: .72rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-weight: 500;
}
.lang-astro { background: rgba(255,93,1,.12); color: #ff5d01; }
.lang-js { background: rgba(247,223,30,.12); color: #f7df1e; }
.lang-css { background: rgba(59,130,246,.12); color: #60a5fa; }
.lang-py { background: rgba(55,118,171,.12); color: #3b82f6; }
.lang-nb { background: rgba(245,158,11,.12); color: #f59e0b; }
.lang-php { background: rgba(79,93,149,.12); color: #818cf8; }

.project-link {
  color: var(--text2);
  transition: color .2s;
  display: flex;
}
.project-link svg { width: 20px; height: 20px; }
.project-link:hover { color: var(--accent2); }

.project-private {
  font-family: 'Fira Code', monospace;
  font-size: .7rem;
  padding: .2rem .65rem;
  background: rgba(85,85,119,.15);
  color: var(--text2);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.project-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
}
.project-desc {
  font-size: .87rem;
  color: var(--text2);
  line-height: 1.6;
  flex: 1;
}
.project-tags {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.tag {
  font-family: 'Fira Code', monospace;
  font-size: .72rem;
  padding: .2rem .6rem;
  background: rgba(124,58,237,.12);
  color: var(--accent2);
  border-radius: 4px;
}

.projects-more {
  text-align: center;
  margin-top: 3rem;
}

/* CONTACT */
#contact { background: var(--bg); }

.contact-sub {
  color: var(--text2);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  max-width: 500px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 700px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.contact-card:hover {
  border-color: var(--accent2);
  transform: translateY(-3px);
}
.contact-icon {
  width: 48px; height: 48px;
  background: rgba(124,58,237,.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
  flex-shrink: 0;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-label {
  font-size: .78rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .2rem;
}
.contact-value {
  font-size: .92rem;
  color: var(--white);
  font-weight: 500;
}

/* FOOTER */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem;
}
footer p { color: var(--text2); font-size: .85rem; }
.footer-copy { margin-top: .4rem; font-size: .78rem; opacity: .5; }

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .about-stats { justify-content: center; }

  .hero-scroll { display: none; }

  section { padding: 70px 0; }
}
@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}
