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

:root {
  --bg: #050505;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #ededed;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: white;
}

/* ─── Noise Texture ─── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ─── Animated Gradient Background ─── */
.gradient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.gradient-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.gradient-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.gradient-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.15), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  background: rgba(5, 5, 5, 0.7);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 450;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 8px 20px !important;
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  transition: all 0.2s !important;
}

.nav-cta:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 48px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-content { width: 100%; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeUp 0.8s ease-out;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}

.hero-line { display: block; }

.hero-line:nth-child(2) {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.55em;
  letter-spacing: -0.01em;
  margin-top: 8px;
}

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

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 36px;
  animation: fadeUp 0.8s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 56px;
  animation: fadeUp 0.8s ease-out 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
  color: var(--text);
}

.hero-stack {
  animation: fadeUp 0.8s ease-out 0.4s both;
}

.stack-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  display: block;
  margin-bottom: 12px;
}

.stack-icons { display: flex; flex-wrap: wrap; gap: 8px; }

.stack-tag {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-weight: 400;
  transition: all 0.2s;
}

.stack-tag:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-glow);
}

/* ─── Section Common ─── */
.section-header {
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--mono);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 480px;
}

/* ─── Projects ─── */
.projects {
  padding: 80px 48px 120px;
  max-width: 1100px;
  margin: 0 auto;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.project-card {
  position: relative;
  padding: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow: hidden;
}

.project-card-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--accent-glow), transparent 60%);
  pointer-events: none;
}

.project-card:hover .project-card-glow { opacity: 1; }

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.project-card-featured {
  border-color: rgba(99, 102, 241, 0.15);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), var(--surface));
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.project-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}

.project-links { display: flex; gap: 12px; }

.project-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-muted);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.project-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.project-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.project-features {
  list-style: none;
  margin-bottom: 24px;
  display: grid;
  gap: 6px;
}

.project-features li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.project-features li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--accent-2);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.12);
}

/* ─── About ─── */
.about {
  padding: 80px 48px 120px;
  max-width: 900px;
  margin: 0 auto;
}

.about-text {
  display: grid;
  gap: 20px;
}

.about-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-text strong { color: var(--text); font-weight: 500; }

/* ─── Contact ─── */
.contact {
  padding: 80px 48px 120px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 16px 0;
}

.contact-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.25s;
}

.contact-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-2px);
}

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

/* ─── Animations ─── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-animate] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ─── */
@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card-featured {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav { padding: 16px 24px; }
  .nav-links { gap: 20px; }
  .hero { padding: 100px 24px 60px; }
  .projects { padding: 60px 24px 80px; }
  .about { padding: 60px 24px 80px; }
  .contact { padding: 60px 24px 80px; }
  .project-card { padding: 28px; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
  .contact-links { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .hero-title { font-size: 2.2rem; }
}
