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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #0d0d0d;
  color: #f0f0f0;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   Navbar scroll effect
============================================================ */
#navbar {
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================================
   Hero
============================================================ */
.hero-bg {
  filter: brightness(0.35) saturate(1.2);
}

/* Radial purple ambient glow — visible when no bg image */
.bg-gradient-radial {
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
}

.hero-dot-grid {
  background-color: #0d0d0d;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Same dot grid at same positions, slightly brighter + 0.5px larger.
   A soft spotlight mask travels diagonally — only the dots under the
   spotlight are revealed, creating the per-dot glow/grow effect. */
.hero-dot-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.22) 1.5px, transparent 2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
  -webkit-mask-size: 50% 50%;
  mask-size: 50% 50%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: dot-wave 9s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
}

@keyframes dot-wave {
  0%   { mask-position: -100% -100%; -webkit-mask-position: -100% -100%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { mask-position: 200% 200%; -webkit-mask-position: 200% 200%; opacity: 0; }
}

.hero-dot-glow {
  background: radial-gradient(ellipse 70% 55% at 50% 45%, rgba(124,58,237,0.15) 0%, transparent 70%);
}

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

/* Scroll indicator bounce */
.scroll-dot {
  animation: scroll-bounce 1.8s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%       { transform: translateY(8px); opacity: 0.3; }
}

/* ============================================================
   Shadow glow (accent buttons)
============================================================ */
.shadow-glow {
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.35);
}

.shadow-glow:hover {
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.45);
}

/* ============================================================
   Tags
============================================================ */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #a78bfa;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tag-sm {
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888888;
  font-size: 0.8rem;
  font-weight: 400;
  transition: border-color 0.2s, color 0.2s;
}

.skill-tag:hover {
  border-color: rgba(124, 58, 237, 0.4);
  color: #a78bfa;
}

/* ============================================================
   Project cards
============================================================ */
.project-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.featured-card {
  transition: box-shadow 0.3s ease;
}

.featured-card:hover {
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.25), 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   Image placeholders (when images are missing)
============================================================ */
.img-placeholder,
.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1c1c1c 0%, #141414 100%);
  color: #333;
  font-size: 0.75rem;
}

.img-placeholder::after {
  content: 'Image coming soon';
  color: #444;
  font-size: 0.7rem;
}

.photo-placeholder::after {
  content: 'A';
  font-size: 2rem;
  font-weight: 700;
  color: #7c3aed;
  font-family: 'Space Grotesk', sans-serif;
}

/* ============================================================
   Scroll-reveal animations
============================================================ */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Elements waiting to be revealed by IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings inside a grid */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }

/* ============================================================
   Contact buttons
============================================================ */
.contact-btn {
  text-decoration: none;
}

/* ============================================================
   Scrollbar styling
============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7c3aed;
}

/* ============================================================
   Selection color
============================================================ */
::selection {
  background: rgba(124, 58, 237, 0.4);
  color: #f0f0f0;
}

/* ============================================================
   Focus outline (accessibility)
============================================================ */
:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
}
