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

:root {
  --bg:        #0d0d0f;
  --bg2:       #13131a;
  --bg3:       #1a1a24;
  --border:    rgba(255,255,255,.08);
  --accent:    #7c6dfa;
  --accent2:   #a78bfa;
  --gold:      #f59e0b;
  --green:     #22c55e;
  --text:      #e8e8f0;
  --muted:     #8585a0;
  --radius:    12px;
  --radius-lg: 20px;
}

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }

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

/* ── Navbar ─────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  background: rgba(13,13,15,.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}

.nav-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent2);
  margin-right: auto;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: .875rem;
  color: var(--muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

.nav-socials {
  display: flex;
  gap: .75rem;
}

.nav-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color .2s, border-color .2s;
}
.nav-socials a:hover { color: var(--text); border-color: var(--accent); }
.nav-socials svg { width: 16px; height: 16px; }

/* ── Hero ───────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 2rem 3rem;
}

/* dot-grid background */
#hero::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(ellipse 70% 80% at 25% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 25% 50%, black 20%, transparent 100%);
}

/* purple ambient glow */
#hero::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,109,250,.1) 0%, transparent 70%);
  top: 40%;
  left: 22%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: .75rem;
}
.hero-tag::before {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent2);
  border-radius: 1px;
}

#hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.accent {
  background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 40%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .9rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: .8rem;
  color: var(--muted);
}

.badge--work { color: var(--green); border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.08); }

.badge-icon { width: 14px; height: 14px; flex-shrink: 0; }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot--green {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,.1); }
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent2); transform: translateY(-1px); }

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent2); transform: translateY(-1px); }

/* ── Code window (hero visual) ──────────────────── */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  animation: card-glow 4s ease-in-out infinite alternate;
}

@keyframes card-glow {
  from { box-shadow: 0 0 0 1px var(--border); }
  to   { box-shadow: 0 0 0 1px rgba(124,109,250,.35), 0 0 40px rgba(124,109,250,.1); }
}

.hero-card__line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .2;
}
.hero-card__line:nth-child(1) { top: 30%; }
.hero-card__line:nth-child(2) { top: 60%; }
.hero-card__line:nth-child(3) { top: 85%; }

.code-window {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0a0e;
}

.code-window__bar {
  display: flex;
  gap: 6px;
  padding: .6rem .9rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.code-window__bar span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border);
}
.code-window__bar span:nth-child(1) { background: #ff5f57; }
.code-window__bar span:nth-child(2) { background: #ffbd2e; }
.code-window__bar span:nth-child(3) { background: #28c840; }

.code-window__body {
  padding: 1.25rem 1.4rem;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: .82rem;
  line-height: 1.7;
  overflow-x: auto;
}

.c-kw  { color: #c792ea; }
.c-cls { color: #82aaff; }
.c-fn  { color: #82aaff; }
.c-str { color: #c3e88d; }

/* ── Sections ───────────────────────────────────── */
section {
  padding: 4rem 2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.container--narrow {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.about-text strong { color: var(--text); }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent2);
}

.stat-label {
  font-size: .8rem;
  color: var(--muted);
}

/* ── Portfolio ──────────────────────────────────── */
#portfolio { background: var(--bg); }

.portfolio-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-left: .25rem;
}

/* Tags */
.tag {
  display: inline-flex;
  padding: .25rem .7rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag--commercial { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.3);  color: var(--gold); }
.tag--shipped    { background: rgba(34,197,94,.1);   border-color: rgba(34,197,94,.3);   color: var(--green); }
.tag--wip        { background: rgba(124,109,250,.1); border-color: rgba(124,109,250,.3); color: var(--accent2); }
.tag--personal   { background: rgba(6,182,212,.1);   border-color: rgba(6,182,212,.3);   color: #22d3ee; }
.tag--academic   { background: rgba(99,102,241,.1);  border-color: rgba(99,102,241,.3);  color: #a5b4fc; }

/* Project cards */
.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  transition: border-color .25s;
}
.project-card:hover { border-color: rgba(124,109,250,.4); }

.project-card--reverse { direction: rtl; }
.project-card--reverse > * { direction: ltr; }

.project-card--featured {
  border-color: rgba(245,158,11,.2);
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(245,158,11,.04) 100%);
}
.project-card--featured:hover { border-color: rgba(245,158,11,.5); }

.project-card--wip {
  border-color: rgba(124,109,250,.2);
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(124,109,250,.04) 100%);
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .8rem;
}

.project-card__info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: .6rem;
}

.project-desc {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.5rem;
}

.feature-list li {
  font-size: .85rem;
  color: var(--muted);
  padding-left: 1.2rem;
  position: relative;
}
.feature-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .6rem 0 1rem;
  padding-bottom: .75rem;
  padding-top: .45rem;
  border-bottom: 1px solid var(--border);
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

/* Project visuals */
.project-card__visual {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg3);
}

.project-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__visual--multi {
  aspect-ratio: auto;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: .5rem;
  background: transparent;
}

.project-card__visual--multi img {
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Skills ─────────────────────────────────────── */
#skills { background: var(--bg2); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.skill-group {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.skill-group h4 {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .8rem;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: .82rem;
  transition: border-color .2s;
}
.skill-item:hover { border-color: var(--accent); }
.skill-item img { width: 18px; height: 18px; object-fit: contain; }

.skill-item--text svg { flex-shrink: 0; opacity: .7; }

.lang-level {
  margin-left: .25rem;
  font-size: .7rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .1rem .45rem;
}

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

.contact-sub {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: .95rem;
}
.contact-sub a { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}

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

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 820px) {
  #hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 80px;
  }
  .hero-badges { justify-content: center; }
  .hero-visual { display: none; }

  .about-grid { grid-template-columns: 1fr; }

  .project-card {
    grid-template-columns: 1fr;
    padding: 1.75rem;
  }
  .project-card--reverse { direction: ltr; }
  .project-card__visual { display: none; }

  .nav-links { display: none; }
}

@media (max-width: 480px) {
  section { padding: 4rem 1.25rem; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}
