/* === Reset & Tokens === */
:root {
  --bg: #09090b;
  --surface: #111113;
  --surface2: #18181b;
  --border: rgba(255,255,255,.08);
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #a78bfa;
  --accent2: #6d28d9;
  --accent-glow: rgba(167,139,250,.15);
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* === Topbar === */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9,9,11,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px;
}
.logo__icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--accent-glow);
  border: 1px solid rgba(167,139,250,.25);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 14px;
}
.topnav { display: flex; align-items: center; gap: 24px; }
.topnav a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color .2s;
}
.topnav a:hover { color: var(--text); }

.burger {
  display: none; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.burger span {
  display: block; width: 18px; height: 2px;
  background: var(--muted); border-radius: 2px;
  transition: .2s;
}

/* Language switch */
.langSwitch { display: flex; gap: 4px; }
.langSw {
  padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
  transition: .2s;
}
.langSw:hover { color: var(--text); }
.langSw.active {
  color: var(--accent); border-color: rgba(167,139,250,.3);
  background: var(--accent-glow);
}

/* === Hero === */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(circle, rgba(167,139,250,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero__badge {
  display: inline-block;
  padding: 8px 16px; border-radius: 999px;
  background: var(--accent-glow);
  border: 1px solid rgba(167,139,250,.2);
  color: var(--accent); font-size: 14px; font-weight: 600;
  margin-bottom: 28px;
}
.hero__h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -.02em;
  max-width: 700px; margin: 0 auto 20px;
}
.hero__p {
  color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 32px;
  line-height: 1.7;
}
.hero__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero__tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.htag {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--accent {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border-color: transparent; color: #fff;
}
.btn--accent:hover { box-shadow: 0 8px 30px rgba(167,139,250,.25); }
.btn--outline { background: transparent; border-color: var(--border); }
.btn--outline:hover { border-color: rgba(167,139,250,.3); }
.btn--sm { padding: 8px 16px; font-size: 13px; }

/* === Sections === */
.section { padding: 80px 0; }
.section--alt { background: var(--surface); }
.section__h2 {
  font-size: clamp(24px, 3vw, 36px); font-weight: 800;
  margin-bottom: 8px;
}
.section__sub { color: var(--muted); margin-bottom: 32px; }

/* === Project cards === */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  transition: .2s;
}
.chip:hover { color: var(--text); border-color: rgba(167,139,250,.2); }
.chip.active {
  color: var(--accent); border-color: rgba(167,139,250,.3);
  background: var(--accent-glow);
}

.pgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.pcard {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.pcard:hover {
  transform: translateY(-4px);
  border-color: rgba(167,139,250,.25);
  box-shadow: 0 16px 48px rgba(0,0,0,.3);
}
.pcard__img {
  position: relative; height: 200px; overflow: hidden;
  background: linear-gradient(135deg, var(--surface2), var(--bg));
  cursor: zoom-in;
}
.pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pcard:hover .pcard__img img { transform: scale(1.03); }
.pcard__badge {
  position: absolute; bottom: 12px; left: 12px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
}
.pcard__body { padding: 20px; }
.pcard__title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.pcard__desc { color: var(--muted); font-size: 14px; margin-bottom: 14px; line-height: 1.5; }
.pcard__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.stag {
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.15);
  color: var(--accent);
}

/* === Skills grid === */
.sgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.scard {
  padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
}
.scard__h { font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.scard__items { display: flex; flex-wrap: wrap; gap: 6px; }

/* === Services grid === */
.svgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.svcard {
  padding: 28px 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  transition: transform .2s, border-color .2s;
}
.svcard:hover { transform: translateY(-3px); border-color: rgba(167,139,250,.2); }
.svcard__icon { font-size: 28px; margin-bottom: 14px; }
.svcard h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.svcard p { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.footer__inner {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 13px;
}
.footer__inner a { color: var(--accent); }

/* === Lightbox === */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none; place-items: center;
}
.lightbox.open { display: grid; }
.lightbox__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.8); backdrop-filter: blur(8px);
}
.lightbox__wrap {
  position: relative; max-width: 900px; width: calc(100% - 40px);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.lightbox__name { font-weight: 700; font-size: 14px; }
.lightbox__x {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); font-size: 20px;
  display: grid; place-items: center;
}
.lightbox__img { width: 100%; height: auto; }

/* === Language gate === */
.has-lang-gate { overflow: hidden; }
.langGate {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
}
.langGate__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85); backdrop-filter: blur(10px);
}
.langGate__box {
  position: relative; width: min(480px, calc(100% - 32px));
  padding: 32px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface); text-align: center;
}
.langGate__title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.langGate__sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.langGate__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.langOpt {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  font-weight: 700; font-size: 15px;
  transition: .2s;
}
.langOpt:hover {
  border-color: rgba(167,139,250,.3);
  transform: translateY(-2px);
}
.langOpt__flag { font-size: 24px; }

/* === Contact Popup === */
.contactPopup {
  position: fixed; bottom: 90px; right: 24px; z-index: 200;
  width: 320px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transform: translateY(12px) scale(.96);
  opacity: 0; pointer-events: none;
  transition: transform .25s, opacity .25s;
}
.contactPopup.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: auto;
}
.contactPopup__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.contactPopup__title { font-weight: 700; font-size: 15px; }
.contactPopup__close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); font-size: 18px;
  display: grid; place-items: center; cursor: pointer;
}
.contactPopup__close:hover { border-color: rgba(167,139,250,.3); }
.contactPopup__body { padding: 8px; }

.contactOpt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--text); text-decoration: none; font: inherit;
  transition: .2s; cursor: pointer; text-align: left;
}
.contactOpt:hover {
  background: rgba(167,139,250,.06);
  border-color: rgba(167,139,250,.15);
}
.contactOpt__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent-glow);
  border: 1px solid rgba(167,139,250,.2);
  color: var(--accent);
}
.contactOpt__icon--sm {
  width: auto; height: auto; background: none; border: none;
  color: var(--muted);
}
.contactOpt__info { flex: 1; min-width: 0; }
.contactOpt__label { display: block; font-weight: 600; font-size: 14px; }
.contactOpt__sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.contactOpt__arrow { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.contactOpt__copyLabel { color: var(--muted); font-size: 12px; }

.contactOpt--copy {
  padding: 6px 12px; margin: -4px 0;
  border-radius: 8px;
}
.contactOpt--copy:hover { background: rgba(255,255,255,.04); }
.contactOpt--copy.copied .contactOpt__copyLabel { color: var(--accent); }

/* === Floating Action Button === */
.fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 199;
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid rgba(167,139,250,.3);
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 30px rgba(167,139,250,.3);
  transition: .25s;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(167,139,250,.4); }
.fab.active { background: var(--surface); border-color: var(--border); color: var(--text); }

.nav__contact { white-space: nowrap; }
@media (min-width: 769px) { .fab { display: none; } }

/* === Responsive === */
@media (max-width: 768px) {
  .burger { display: flex; }
  .topnav {
    position: absolute; top: 64px; right: 16px;
    flex-direction: column; align-items: stretch;
    background: rgba(17,17,19,.96); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; gap: 12px; min-width: 200px;
    display: none;
  }
  .topnav.open { display: flex; }
  .hero { padding: 60px 0 50px; }
  .section { padding: 60px 0; }
  .pgrid { grid-template-columns: 1fr; }
  .nav__contact { display: none; }
  .contactPopup { right: 16px; left: 16px; width: auto; bottom: 96px; }
}

@media (max-width: 480px) {
  .hero__h1 { font-size: 28px; }
  .langGate__opts { grid-template-columns: 1fr; }
  .sgrid { grid-template-columns: 1fr; }
  .svgrid { grid-template-columns: 1fr; }
}
