:root {
  color-scheme: dark;
  --bg: #0b0f1a;
  --bg-alt: #111827;
  --accent: #38bdf8;
  --accent-soft: #0ea5e9;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --card: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.2);
  --glow: 0 0 25px rgba(56, 189, 248, 0.35);
  font-family: "Fira Code", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  z-index: -2;
  animation: gridPulse 10s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.hero {
  padding: 32px 8vw 80px;
  position: relative;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 48px;
  margin-top: 60px;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-text h1 span { color: var(--accent); }

.tag {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.6);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border);
}

.terminal-title {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-body {
  padding: 24px;
  display: grid;
  gap: 12px;
}

.line { color: var(--muted); }
.line.highlight { color: var(--accent); }

.projects { padding: 0 8vw 80px; }

.section-heading { margin-bottom: 32px; }

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 12px;
}

.section-subtitle { color: var(--muted); }

.project-grid {
  display: grid;
  gap: 32px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
}

.project-card.visible {
  animation: fadeUp 0.9s ease forwards;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

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

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

.project-visuals {
  display: grid;
  gap: 12px;
}

/* ✅ AGORA image-slot é IMG */
.image-slot {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(15, 23, 42, 0.7));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: block;
}

.image-slot:hover {
  transform: scale(1.02);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 14px 40px rgba(56, 189, 248, 0.12);
}

/* ✅ fallback visual se a imagem não carregar */
.image-slot[alt] {
  color: transparent;
}

.project-info h3 {
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.project-info p {
  color: var(--muted);
  margin-bottom: 16px;
}

.project-info ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.project-info li::before {
  content: ">";
  margin-right: 8px;
  color: var(--accent);
}

.stack { padding: 0 8vw 80px; }

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

.stack-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
  color: var(--text);
  transition: transform 0.3s ease, border 0.3s ease;
}

.stack-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.footer {
  padding: 50px 8vw 70px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer p {
  color: var(--muted);
  margin-top: 12px;
}

@media (max-width: 900px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .image-slot {
    height: 190px;
  }
}

@media (max-width: 700px) {
  .nav-links {
    flex-wrap: wrap;
  }

  .hero {
    padding: 24px 6vw 60px;
  }

  .projects,
  .stack,
  .footer {
    padding-left: 6vw;
    padding-right: 6vw;
  }

  .image-slot {
    height: 200px;
  }
}
