/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

::selection {
  background: #3fb95033;
  color: #3fb950;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8b949e; }

/* ── Grid background for hero ── */
.grid-bg {
  background-image:
    linear-gradient(rgba(48, 54, 61, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 54, 61, 0.4) 1px, transparent 1px);
  background-size: 40px 40px;
}
.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 40%, #0d1117 100%);
}

/* ── Navbar scroll behaviour ── */
#navbar { background: transparent; }
#navbar.scrolled {
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #30363d;
}

/* ── Section headings fade-in ── */
.section-heading {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.section-heading.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Project cards ── */
.project-card {
  transform: translateY(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

/* ── Screenshot previews — clickable ── */
[data-lb-src] {
  cursor: zoom-in;
}

/* ── Skill groups ── */
.skill-group {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.25s ease;
}
.skill-group.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stat cards ── */
.stat-card {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.stat-card.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  border-radius: 4px;
  background: rgba(121, 192, 255, 0.08);
  color: #79c0ff;
  border: 1px solid rgba(121, 192, 255, 0.2);
  font-family: inherit;
}

/* ── Typed cursor blink ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}

/* ── Glow pulse on hero name ── */
@keyframes glow {
  0%, 100% { text-shadow: 0 0 8px rgba(63,185,80,0.3); }
  50%       { text-shadow: 0 0 20px rgba(63,185,80,0.7); }
}
#typed-name {
  animation: glow 3s ease-in-out infinite;
  animation-play-state: paused;
}
#typed-name.done {
  animation-play-state: running;
}

/* ── Scan-line overlay (subtle) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Mini project cards ── */
.mini-card {
  transition: border-color 0.25s ease, transform 0.2s ease;
}
.mini-card:hover {
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════ */
#lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#lb-overlay.lb-open {
  opacity: 1;
  pointer-events: all;
}

#lb-img-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.88) translateY(12px);
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
}
#lb-overlay.lb-open #lb-img-wrap {
  transform: scale(1) translateY(0);
}

#lb-img {
  display: block;
  max-width: min(90vw, 1100px);
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid #30363d;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.04);
  object-fit: contain;
}

#lb-caption {
  margin-top: 16px;
  font-size: 0.72rem;
  color: #8b949e;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

#lb-close {
  position: absolute;
  top: -44px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #8b949e;
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  line-height: 1;
}
#lb-close:hover {
  background: #1f2937;
  border-color: #ff7b72;
  color: #ff7b72;
}

/* ══════════════════════════════════════════════════
   CONTACT FORM
══════════════════════════════════════════════════ */
.form-label {
  display: block;
  font-size: 0.68rem;
  color: #8b949e;
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #c9d1d9;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: #79c0ff;
  box-shadow: 0 0 0 3px rgba(121, 192, 255, 0.12);
}
.form-input::placeholder {
  color: #30363d;
}
.form-input:hover:not(:focus) {
  border-color: #484f58;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  padding: 11px 0;
  background: transparent;
  border: 1px solid #3fb950;
  border-radius: 6px;
  color: #3fb950;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.1s ease;
}
.form-submit:hover {
  background: #3fb950;
  color: #0d1117;
  box-shadow: 0 0 20px rgba(63, 185, 80, 0.28);
}
.form-submit:active {
  transform: scale(0.98);
}
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#form-success {
  border: 1px solid rgba(63, 185, 80, 0.3);
  background: rgba(63, 185, 80, 0.06);
  border-radius: 6px;
  padding: 10px;
  font-size: 0.75rem;
  color: #3fb950;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Responsive adjustments ── */
@media (max-width: 640px) {
  #hero h1 { font-size: 2rem; }
  #lb-img  { max-width: 95vw; }
}
