/* ============ VARIABLES ============ */
:root {
  --bg: #0a0c14;
  --bg-alt: #0d1020;
  --surface: #12152670;
  --surface-solid: #131628;
  --border: #ffffff14;
  --text: #eef0f8;
  --text-muted: #9aa1bd;
  --text-dim: #6b7290;
  --accent-blue: #4f7cff;
  --accent-purple: #a855f7;
  --gradient: linear-gradient(120deg, var(--accent-blue), var(--accent-purple));
  --gradient-soft: linear-gradient(120deg, #4f7cff22, #a855f722);
  --shadow-glow: 0 8px 30px -8px #4f7cff55;
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1140px;
  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

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

h1, h2, h3, .logo, .code-card__filename {
  font-family: 'Poppins', 'Inter', sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px -8px #4f7cff88; }

.btn--outline {
  border: 1px solid var(--border);
  background: #ffffff08;
  color: var(--text);
}
.btn--outline:hover { border-color: #ffffff33; background: #ffffff10; transform: translateY(-2px); }

.btn--sm { padding: 10px 20px; font-size: 0.85rem; }
.btn--full { width: 100%; }

/* ============ HEADER ============ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: #0a0c14cc;
  backdrop-filter: blur(14px);
  border-color: var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.logo--code {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.3rem;
}
.logo__bracket { color: var(--text-dim); }
.logo__slash { color: var(--accent-purple); }

.nav__list {
  display: flex;
  gap: 8px;
}
.nav__link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s ease, background .2s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link.active { color: var(--text); background: #ffffff0f; }

.header__cta { flex-shrink: 0; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
  transition: transform .25s ease, opacity .25s ease;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.hero__glow--1 { background: var(--accent-blue); top: -180px; left: -120px; }
.hero__glow--2 { background: var(--accent-purple); bottom: -220px; right: -160px; }

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.hero__title {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.hero__text {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 500px;
  margin-bottom: 34px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 46px;
}

.hero__stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat__num {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label { color: var(--text-dim); font-size: 0.82rem; }

/* Code card visual */
.hero__visual { display: flex; justify-content: center; }
.code-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px #00000080, var(--shadow-glow);
  transform: perspective(1000px) rotateY(-6deg) rotateX(2deg);
}
.code-card__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #ffffff08;
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }
.code-card__filename {
  margin-left: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.code-card__body {
  padding: 22px 20px;
  font-family: 'Courier New', monospace;
  font-size: 0.86rem;
  line-height: 1.7;
  color: #c9d1f5;
  white-space: pre-wrap;
  overflow-x: auto;
}
.c-key { color: #ff7edb; }
.c-var { color: #7ee6ff; }
.c-prop { color: #4f7cff; }
.c-str { color: #a8ff9e; }
.c-fn { color: #ffd76e; }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border);
  border-radius: 20px;
  z-index: 1;
}
.scroll-cue span {
  position: absolute;
  top: 6px; left: 50%;
  width: 5px; height: 5px;
  background: var(--accent-blue);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: scrollCue 1.6s ease-in-out infinite;
}
@keyframes scrollCue {
  0% { opacity: 1; top: 6px; }
  70% { opacity: 0; top: 22px; }
  100% { opacity: 0; top: 22px; }
}

/* ============ SECTIONS ============ */
.section { padding: 120px 0; position: relative; }
.section--alt { background: var(--bg-alt); }

.section__eyebrow {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.section__title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 640px;
  margin-bottom: 16px;
}
.section__subtitle {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 50px;
}

/* ============ ABOUT ============ */
.about__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: center;
  margin-top: 40px;
}
.avatar-blob {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 32% 68% 62% 38% / 45% 40% 60% 55%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  position: relative;
}
.avatar-blob::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: var(--bg);
  opacity: 0.12;
}
.avatar-mark {
  font-family: 'Courier New', monospace;
  font-size: 3.4rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
  letter-spacing: -0.02em;
}
.avatar-mark__bracket { color: rgba(255, 255, 255, 0.55); }
.avatar-mark__slash { color: rgba(255, 255, 255, 0.85); }

.about__content p { color: var(--text-muted); margin-bottom: 18px; }
.about__list { margin-top: 24px; display: grid; gap: 12px; }
.about__list li { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gradient-soft);
  color: var(--accent-blue);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ============ SKILLS ============ */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.skill-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform .25s ease, border-color .25s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: #ffffff2a; }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gradient-soft);
  border: 1px solid #ffffff14;
  color: var(--text-muted);
}
.tags--sm .tag { font-size: 0.74rem; padding: 5px 10px; }

/* ============ PROJECTS ============ */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 40px;
}
.project-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: #ffffff2a;
  box-shadow: 0 24px 50px -20px #00000090;
}
.project-card__img-link { position: relative; display: block; overflow: hidden; aspect-ratio: 16/10; }
.project-card__img-link img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  transition: transform .5s ease;
}
.project-card:hover .project-card__img-link img { transform: scale(1.06); }
.project-card__tag {
  position: absolute;
  top: 14px; left: 14px;
  background: #0a0c14cc;
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}
.project-card__body { padding: 24px; }
.project-card__body h3 { font-size: 1.15rem; margin-bottom: 10px; }
.project-card__body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-blue);
  transition: gap .2s ease;
}
.project-link:hover { gap: 10px; }

/* ============ EXPERIENCE / TIMELINE ============ */
.timeline {
  position: relative;
  max-width: 720px;
  margin-top: 40px;
  padding-left: 30px;
  border-left: 2px solid var(--border);
}
.timeline__item { position: relative; padding-bottom: 44px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: -37px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 4px var(--bg-alt), 0 0 0 5px var(--border);
}
.timeline__date {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 8px;
}
.timeline__content h3 { font-size: 1.1rem; margin-bottom: 8px; }
.timeline__content p { color: var(--text-muted); font-size: 0.94rem; max-width: 560px; }

/* ============ SERVICES ============ */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.service-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform .25s ease, border-color .25s ease;
}
.service-card:hover { transform: translateY(-4px); border-color: #ffffff2a; }
.service-card__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border-radius: 12px;
  background: var(--gradient-soft);
  margin-bottom: 18px;
}
.service-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.service-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ============ CONTACT ============ */
.contact__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  margin-top: 40px;
  align-items: start;
}
.contact__info { display: grid; gap: 14px; }
.contact__item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color .2s ease, transform .2s ease;
}
.contact__item:hover { border-color: #ffffff2a; transform: translateX(4px); }
.contact__item--static { cursor: default; }
.contact__item--static:hover { transform: none; border-color: var(--border); }
.contact__icon { font-size: 1.3rem; }
.contact__item strong { display: block; font-size: 0.95rem; }
.contact__item span { color: var(--text-dim); font-size: 0.82rem; }

.socials { display: flex; gap: 12px; margin-top: 10px; }
.social-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text-muted);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.social-btn:hover { color: var(--text); border-color: #ffffff33; transform: translateY(-3px); }

.contact__form {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  gap: 18px;
}
.form-row { display: grid; gap: 8px; }
.form-row label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-row input, .form-row textarea {
  background: #ffffff0a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color .2s ease, background .2s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: #ffffff10;
}
.form-status {
  font-size: 0.88rem;
  min-height: 1.2em;
  text-align: center;
}
.form-status.success { color: #4ade80; }
.form-status.error { color: #f87171; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 50px 0;
  text-align: center;
}
.footer__inner { display: grid; gap: 10px; justify-items: center; }
.footer p { color: var(--text-dim); font-size: 0.88rem; }
.footer__copy { font-size: 0.8rem; margin-top: 10px; }

.to-top {
  position: fixed;
  bottom: 26px; right: 26px;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 900;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .code-card { transform: none; max-width: 100%; }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .avatar-blob { max-width: 220px; }
  .skills__grid { grid-template-columns: repeat(2, 1fr); }
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .nav { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #0a0c14f5; backdrop-filter: blur(16px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 60px;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    z-index: 999;
  }
  .nav.open { transform: translateY(0); opacity: 1; }
  .nav__list { flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 0 24px; }
  .nav__link { display: block; width: 100%; text-align: center; padding: 14px; font-size: 1.05rem; }
  .header__cta { display: none; }
  .burger { display: flex; }

  .hero__stats { gap: 24px; }
  .skills__grid { grid-template-columns: 1fr; }
  .projects__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr; }
  .section { padding: 90px 0; }
}

@media (max-width: 420px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
}
