:root {
  --bg: #0f1720;
  --card: #0b1220;
  --muted: #9aa4b2;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --glass: rgba(255, 255, 255, 0.04);
  --radius: 14px;
  --max-width: 1100px;
  --container-padding: 1.5rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100%;
  color: #e6eef6;
  line-height: 1.6;
  background: linear-gradient(180deg, #071428 0%, #041022 100%);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 0;
  backdrop-filter: blur(10px);
  background: rgba(6, 12, 20, 0.6);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-inner {
  display: flex;
  justify-content: center;
}

.nav a {
  margin: 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  transition: 0.2s;
}

.nav a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* PERFIL */
.perfil-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 1.8rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.05);
}

.perfil-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.perfil-info h2 {
  margin: 0 0 0.4rem 0;
  font-size: 1.5rem;
}

.perfil-info p {
  margin: 0.2rem 0;
}

.perfil-info a {
  color: var(--accent);
  text-decoration: none;
  transition: 0.2s;
}

.perfil-info a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.perfil-buttons {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* BOTONES */
.btn, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: 0.3s ease;
  text-decoration: none; 
}

.btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-outline {
  background: rgba(255,255,255,0.05);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* HERO */
.hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 0 2rem;
  margin-top: -1rem;
}

.hero-content h2 {
  margin: 0 0 .6rem 0;
  font-size: 1.9rem;
  font-weight: 700;
}

.hero-content p {
  margin: .5rem 0;
}

.hero-cta {
  display: flex;
  gap: .7rem;
}

/* SECCIONES */
.section {
  padding: 1.8rem 0 2.4rem;
}

.section h2 {
  margin-bottom: .8rem;
  font-size: 1.5rem;
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}

.skill-card {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.05);
  transition: 0.25s;
}

.skill-card:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-3px);
}

.skill-items {
  margin-top: .7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.skill {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .55rem;
  min-width: 140px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  transition: 0.2s;
}

.skill:hover {
  background: rgba(255,255,255,0.12);
}

.skill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.1rem;
}

.project-card {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.05);
  transition: 0.25s;
}

.project-card:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-4px);
}

.project-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

/* FORMULARIO CONTACTO */
.contact-form {
  max-width: 700px;
  padding: 1.1rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.05);
}

.contact-form label {
  margin-bottom: .7rem;
  display: block;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: .3rem;
  padding: .65rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: inherit;
  transition: 0.25s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
  outline: none;
}

.form-actions {
  margin-top: .7rem;
  display: flex;
  gap: .7rem;
}

/* FOOTER */
.site-footer {
  margin-top: 2.5rem;
  padding: 1rem 0;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-links {
  display: none;
}

/* BOTÓN ARRIBA */
#top-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s, transform 0.2s;
  box-shadow: 0 5px 20px rgba(99,102,241,0.4);
  z-index: 50;
}

#top-button.show {
  opacity: 1;
  pointer-events: auto;
}

#top-button:hover {
  background: var(--accent-hover);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 25px rgba(99,102,241,0.5);
}

/* RESPONSIVE */
@media (max-width: 720px) {
  .container {
    padding: 0 1rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    display: flex;
    flex-direction: column;
    gap: .5rem;
  }

  .nav a {
    margin: 0;
    font-size: 1rem;
  }

  .perfil-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .perfil-buttons {
    justify-content: center;
    width: 100%;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn,
  .hero-cta .btn-outline {
    width: 100%;
  }

  .section {
    padding: 1.5rem 1rem;
  }
}
