/* =========================
   RESET Y VARIABLES
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-main: #0f172a;
  --bg-secondary: #1e293b;
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* =========================
   HEADER / NAV
========================= */
.header {
  background: var(--bg-secondary);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  color: var(--accent);
  font-size: 1.5rem;
}

.menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.menu a {
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.3s;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--accent);
  cursor: pointer;
}

/* =========================
   HERO
========================= */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 3rem;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

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

.hero-text p {
  margin: 1rem 0;
  color: var(--text-muted);
}

.hero-img img {
  max-width: 280px;
  border-radius: 20px;
  box-shadow: 0 0 40px #38bdf855;
  animation: float 6s ease-in-out infinite;
}

/* BOTÓN */
.btn {
  display: inline-block;
  padding: 12px 26px;
  background: var(--accent);
  color: #0f172a;
  border-radius: 10px;
  font-weight: bold;
  text-decoration: none;
  margin-top: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px #38bdf866;
}

/* =========================
   SECCIONES
========================= */
section {
  padding: 4rem 2rem;
}

h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--accent);
}

/* =========================
   ANIMACIÓN SCROLL (CSS)
========================= */
section,
.card,
.project-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.9s ease forwards;
  animation-timeline: view();
  animation-range: entry 0% cover 35%;
}

/* =========================
   SOBRE MI
========================= */
.about p {
  max-width: 800px;
  margin: auto;
  color: var(--text-muted);
  text-align: center;
}

/* =========================
   SERVICIOS
========================= */
.services-grid,
.projects-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card,
.project-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 16px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover,
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(56, 189, 248, 0.15);
}

.card img,
.project-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.card h3,
.project-card h3 {
  margin-bottom: 0.5rem;
}

.card p,
.project-card p {
  color: var(--text-muted);
}

/* =========================
   CONTACTO
========================= */
.contact p {
  text-align: center;
  margin-bottom: 1rem;
}

.contact a {
  color: var(--accent);
  text-decoration: none;
}

/* =========================
   FOOTER
========================= */
.footer {
  text-align: center;
  padding: 1.5rem;
  background: #020617;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* =========================
   MENÚ RESPONSIVE
========================= */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .menu {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 20px;
    top: 70px;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 12px;
  }

  .menu.active {
    display: flex;
  }
}

/* =========================
   ANIMACIONES
========================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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