/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #020617;
  color: #e5e7eb;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================= LAYOUT ================= */
.container {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================= HEADER ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;

  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(12px);

  border-bottom: 1px solid rgba(59,130,246,0.25);
  padding: 1rem 2rem;
}

.header,
.header a {
  color: #e5e7eb;
}



.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.logo span {
  color: #3b82f6;
}


nav a {
  margin-left: 1.5rem;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

nav a:hover {
  opacity: 1;
}


/* ================= HERO ================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(600px at 50% 0%, rgba(59,130,246,0.25), transparent 60%),
    linear-gradient(to bottom, #020617, #020617);
}

.hero-content {
  max-width: 900px;
  padding: 0 1.5rem;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-style: italic;
  opacity: 0.7;
  margin-bottom: 2.5rem;
}

/* ================= BUTTONS ================= */
.btn-primary {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  box-shadow: 0 10px 30px rgba(59,130,246,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(59,130,246,0.5);
}

/* ================= SECTIONS ================= */

section {
  width: 100%;
}


.section {
  padding: 5rem 2rem;
  max-width: 900px;
  margin: auto;
  text-align: center;
}

.section.dark {
  background: #020617;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
}

.section-subtitle {
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* ================= ABOUT ================= */
.about {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: auto;
}

.about-grid {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
}

/* PERFIL */
.about-profile {
  text-align: left;
}

.profile-img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  margin-bottom: 1.5rem;
}

.profile-img img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-role {
  color: #3b82f6;
  font-size: 0.9rem;
}

.profile-text {
  margin: 1.2rem 0 2rem;
  opacity: 0.8;
}

/* ================= TIMELINE ================= */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(59,130,246,0.3);
}

.timeline-item {
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 1.5rem;
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border-radius: 50%;
}

.timeline-year {
  color: #3b82f6;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ================= CARDS ================= */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  background: rgba(2, 6, 23, 0.8);
  padding: 2.5rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(59,130,246,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 60px rgba(59,130,246,0.15);
}

/* ================= CONTACT ================= */
.contact-form {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border-radius: 0.5rem;
  border: none;
  background: #020617;
  color: #e5e7eb;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid #3b82f6;
}

.contact-form button {
  padding: 0.8rem;
  border: none;
  border-radius: 999px;
  background: #3b82f6;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

/* ================= FOOTER ================= */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid #1e293b;
  opacity: 0.7;
}

/* ================= ANIMATIONS ================= */
.fade-up,
.fade-left,
.fade-right,
.fade-down {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up {
  transform: translateY(30px);
}

.fade-left {
  transform: translateX(-30px);
}

.fade-right {
  transform: translateX(30px);
}

.fade-down {
  transform: translateY(-20px);
}

.show {
  opacity: 1;
  transform: translate(0);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-profile {
    text-align: center;
  }

  .profile-img {
    margin: 0 auto 1.5rem;
  }

  .timeline {
    border-left: none;
    padding-left: 0;
  }

  .timeline-item::before {
    display: none;
  }
}

/* ===== SKILLS ===== */
.skills-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: 0.75rem;
  padding: 1.2rem 1.4rem 1.4rem;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.skill-icon {
  font-size: 1rem;
  color: #3b82f6;
  opacity: 0.9;
}

.skill-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: rgba(59,130,246,0.15);
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
}

/* ================= PROJECTS ================= */
.projects-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: auto;
  text-align: center;
}

.projects-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: rgba(2, 6, 23, 0.85);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(59,130,246,0.2);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
  text-align: left;
}

.project-tech-title {
  font-size: 0.7rem;
  letter-spacing: 1px;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background: rgba(59,130,246,0.15);
  color: #3b82f6;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.project-code {
  font-size: 0.85rem;
  color: #e5e7eb;
  opacity: 0.85;
}

.project-code:hover {
  opacity: 1;
}

/* ================= PROJECTS ================= */

.projects-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: auto;
  text-align: center;
}

.projects-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 70px rgba(59,130,246,0.25);
}


/* ================= CONTACT PRO ================= */

.contact-section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: auto;
  text-align: center;
}

.contact-card {
  max-width: 520px;
  margin: 3rem auto 0;
  padding: 2.5rem;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 1.25rem;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}

/* FORM */
.contact-form-pro {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* FLOATING LABELS */
.field {
  position: relative;
}

.field input,
.field textarea {
  width: 100%;
  padding: 1rem 0.9rem;
  background: transparent;
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 0.6rem;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.field label {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: rgba(229,231,235,0.6);
  pointer-events: none;
  transition: all 0.25s ease;
  background: #020617;
  padding: 0 0.3rem;
}

.field textarea + label {
  top: 1.2rem;
}

/* focus + filled */
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: -0.45rem;
  font-size: 0.7rem;
  color: #3b82f6;
}

/* BUTTON */
.btn-primary.full {
  width: 100%;
  margin-top: 0.5rem;
}

/* ================= CONTACT SUCCESS ================= */

.contact-success {
  position: relative;
  max-width: 520px;
  margin: 3rem auto 0;
  text-align: center;
}

.contact-success.hidden {
  display: none;
}

.success-card {
  position: relative;
  z-index: 2;
  padding: 2.5rem;
  background: rgba(2, 6, 23, 0.95);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 1.25rem;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
  animation: popIn 0.5s ease;
}

.success-card h3 {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.success-card p {
  opacity: 0.75;
  margin-bottom: 1.8rem;
}

#confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* animation */
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ================= WHATSAPP FLOAT ================= */

.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #25d366, #1ebe5d);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  z-index: 100;
  animation: pulse 2.2s ease-in-out infinite;
}

.whatsapp-float svg {
  width: 26px;
  height: 26px;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.whatsapp-float:hover {
  animation: none;
  transform: scale(1.12);
}



/* ================= FOOTER ================= */

.footer-links {
  margin-top: 0.6rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: #3b82f6;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-social {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
}

.footer-social a {
  color: #3b82f6;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.footer-social svg {
  width: 22px;
  height: 22px;
}

/* ================= BLOG ================= */

.blog-list {
  margin-top: 3rem;
  display: grid;
  gap: 2rem;
}

.blog-card {
  background: rgba(2,6,23,0.85);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 1rem;
  padding: 1.8rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(59,130,246,0.2);
}

.blog-card h3 {
  margin-bottom: 0.4rem;
}

.blog-date {
  font-size: 0.75rem;
  opacity: 0.6;
}

.blog-card p {
  margin-top: 0.8rem;
  opacity: 0.85;
}

/* ===== BLOG MODAL ===== */

.blog-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;

  z-index: 9999; /* 🔥 clave */
}

.blog-modal.show {
  display: flex;
}

.blog-modal-content {
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;

  background: rgba(2, 6, 23, 0.95);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 1.25rem;
  padding: 2.5rem;

  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
}

#blog-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
}

/* ===== BLOG CAROUSEL ===== */

.blog-carousel {
  margin-top: 2rem;
  position: relative;
}

.blog-carousel.hidden {
  display: none;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
  width: 100%;
}

.carousel-item {
  min-width: 100%;
  flex-shrink: 0;
}

.carousel-item img,
.carousel-item iframe {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 1rem;
}

/* ===== BLOG CAROUSEL BUTTONS ===== */

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(59,130,246,0.35);
  color: #e5e7eb;
  font-size: 1.2rem;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 20;
  opacity: 0.75;
  transition: all 0.25s ease;
}

.carousel-btn:hover {
  background: rgba(59,130,246,0.25);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 8px;
}

.carousel-btn.next {
  right: 8px;
}


/* ================= PROJECT MODAL ================= */

.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.project-modal.show {
  display: flex;
}

.project-modal-content {
  max-width: 800px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;

  background: rgba(2, 6, 23, 0.95);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 1.25rem;
  padding: 2.5rem;

  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
}

#project-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
}

/* ================= PROJECT CAROUSEL ================= */

.project-carousel {
  margin-top: 2rem;
  position: relative;
}

.project-carousel.hidden {
  display: none;
}


/* ===== PROJECT MODAL SEPARATOR ===== */

.project-divider {
  margin: 1.6rem 0 1.8rem;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(59,130,246,0.6),
    transparent
  );
}
