:root {
  --bg: #05070d;
  --bg-soft: #0a0f1f;
  --card: rgba(255,255,255,.07);
  --card-strong: rgba(255,255,255,.11);
  --text: #eef4ff;
  --muted: #9da9c2;
  --line: rgba(255,255,255,.14);
  --cyan: #41f8ff;
  --violet: #8b5cf6;
  --pink: #ff4fd8;
  --green: #5cffb1;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --radius: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top left, rgba(65,248,255,.12), transparent 32%), var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

#starCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: .7;
}
.cursor-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(65,248,255,.18), transparent 65%);
  z-index: -1;
  transition: opacity .3s ease;
}

.page-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  background: #03050a;
  z-index: 9999;
  transition: opacity .6s ease, visibility .6s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--cyan);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(5,7,13,.66);
  backdrop-filter: blur(18px);
  border-radius: 999px;
  z-index: 1000;
  transition: .3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow); background: rgba(5,7,13,.9); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #02040a;
}
.brand-text { letter-spacing: -.02em; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: .25s ease;
}
.site-nav a:hover, .site-nav a.active { background: rgba(255,255,255,.09); color: var(--text); }
.nav-toggle { display: none; background: transparent; border: 0; width: 44px; height: 44px; }
.nav-toggle span { display: block; height: 2px; width: 24px; background: var(--text); margin: 5px auto; transition: .25s; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}
.lang-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  transition: .25s ease;
}
.lang-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }
.lang-btn.active {
  color: #02040a;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 10px 28px rgba(65,248,255,.16);
}

.section { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 110px 0; }
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 150px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; width: 100%; }
.eyebrow, .section-heading span, .section-mini {
  display: inline-flex; align-items: center; gap: 10px; color: var(--cyan); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 22px var(--green); }
h1 { font-size: clamp(44px, 7vw, 86px); line-height: .95; letter-spacing: -.07em; margin: 24px 0; }
h1 span { background: linear-gradient(135deg, var(--cyan), var(--pink)); -webkit-background-clip: text; color: transparent; }
.hero-description { max-width: 660px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 34px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line); font-weight: 800; transition: .25s ease; }
.btn-primary { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #02040a; border: 0; }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(65,248,255,.16); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 640px; }
.hero-stats div { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.05); }
.hero-stats strong { display: block; font-size: 30px; }
.hero-stats span { color: var(--muted); font-size: 13px; }

.profile-card, .glass-card, .skill-card, .project-card, .contact-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.04));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.profile-card { padding: 28px; border-radius: 36px; position: relative; overflow: hidden; }
.profile-card::before { content: ""; position: absolute; inset: -1px; background: radial-gradient(circle at top right, rgba(255,79,216,.22), transparent 40%); pointer-events: none; }
.profile-ring { width: 190px; height: 190px; margin: 0 auto 26px; padding: 4px; border-radius: 50%; background: conic-gradient(var(--cyan), var(--violet), var(--pink), var(--cyan)); }
.profile-avatar { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: #080d19; font-size: 54px; font-weight: 900; }
.profile-card h2 { text-align: center; font-size: 26px; margin-bottom: 8px; }
.profile-card p { text-align: center; color: var(--muted); }
.code-window { margin-top: 24px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: rgba(0,0,0,.28); }
.window-dots { display: flex; gap: 7px; padding: 14px; border-bottom: 1px solid var(--line); }
.window-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); }
pre { padding: 18px; overflow: auto; color: #c8f7ff; font-size: 13px; line-height: 1.7; }

.section-heading { max-width: 760px; margin-bottom: 36px; }
.section-heading h2 { font-size: clamp(30px, 4vw, 54px); letter-spacing: -.05em; line-height: 1.05; margin-top: 14px; }
.about-grid, .project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.glass-card, .project-card { padding: 26px; border-radius: var(--radius); }
.glass-card h3, .project-card h3 { font-size: 22px; margin-bottom: 12px; }
.glass-card p, .project-card p, .timeline-content p, .contact-card p { color: var(--muted); line-height: 1.75; }

.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill-card { padding: 22px; border-radius: 24px; }
.skill-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.skill-top h3 { font-size: 17px; }
.skill-top span { color: var(--cyan); font-weight: 800; }
.progress { height: 10px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress i { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width 1.2s ease; }

.timeline { position: relative; margin-left: 18px; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 11px; width: 2px; background: linear-gradient(var(--cyan), transparent); }
.timeline-item { position: relative; padding-left: 52px; padding-bottom: 28px; }
.timeline-dot { position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 28px rgba(65,248,255,.7); }
.timeline-content { padding: 24px; border-radius: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.timeline-content span { color: var(--cyan); font-weight: 800; font-size: 13px; }
.timeline-content h3 { margin: 8px 0; font-size: 22px; }

.project-card { min-height: 280px; display: flex; flex-direction: column; }
.project-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; color: #02040a; background: linear-gradient(135deg, var(--cyan), var(--violet)); margin-bottom: 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 20px; }
.tags span { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); font-size: 12px; }
.contact-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px; border-radius: 34px; }
.contact-card h2 { font-size: clamp(30px, 4vw, 48px); margin: 10px 0; letter-spacing: -.04em; }
.site-footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; display: flex; justify-content: space-between; color: var(--muted); }
.back-to-top {
  position: fixed;
  right: clamp(18px, 3vw, 38px);
  bottom: clamp(18px, 3vw, 34px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(5,7,13,.82);
  backdrop-filter: blur(14px);
  color: var(--text);
  cursor: pointer;
  z-index: 950;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.88);
  pointer-events: none;
  box-shadow: 0 18px 48px rgba(0,0,0,.36);
  transition: opacity .28s ease, transform .28s ease, visibility .28s ease, border-color .28s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.back-to-top:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: rgba(65,248,255,.55);
  box-shadow: 0 18px 50px rgba(65,248,255,.13);
}
section[id] { scroll-margin-top: 120px; }

.reveal { opacity: 0; transform: translateY(28px); transition: .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .24s; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .header-actions { margin-left: auto; }
  .site-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 24px;
    background: rgba(5,7,13,.96);
    border: 1px solid var(--line);
    transform: translateY(-18px);
    opacity: 0;
    visibility: hidden;
    transition: .25s ease;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .hero-grid, .about-grid, .project-grid, .skills-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .contact-card { flex-direction: column; align-items: flex-start; }
  .brand-text { display: none; }
  .lang-btn { width: 36px; height: 32px; }
}


@media (max-width: 520px) {
  .section { padding: 82px 0; }
  .hero { padding-top: 130px; }
  h1 { font-size: 42px; }
  .site-header { top: 10px; width: calc(100% - 20px); }
  .profile-ring { width: 150px; height: 150px; }
  .site-footer { flex-direction: column; gap: 16px; }
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
