/* Modo claro */
:root {
  --primary: #0a3d3e;        /* Negro turquesa profundo */
  --accent: #2ed9c3;         /* Turquesa claro */
  --bg: #eaf8fa;             /* Celeste muy claro */
  --card-bg: #c7e6ea;        /* Celeste/turquesa suave */
  --text: #1a2326;           /* Gris oscuro */
  --highlight: #5ee6e6;      /* Turquesa vibrante */
  --radius: 14px;
  --shadow: 0 4px 24px rgba(46, 217, 195, 0.10);
  --font-main: 'Montserrat', Arial, sans-serif;
}

/* Modo oscuro */
body.dark-mode {
  --primary: #eaf8fa;        /* Celeste claro para textos */
  --accent: #0a3d3e;         /* Negro turquesa profundo */
  --bg: #14272b;             /* Gris-negro azulado */
  --card-bg: #183c3d;        /* Turquesa oscuro */
  --text: #c7e6ea;           /* Celeste/turquesa suave */
  --highlight: #2ed9c3;      /* Turquesa claro */
  background: var(--bg);
  color: var(--text);
}

/* General */
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  color: var(--primary);
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(46, 217, 195, 0.10);
}

header {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 32px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
}
nav a, .logo {
  color: var(--primary);
}
.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--highlight);
  letter-spacing: 2px;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
nav a:hover {
  color: var(--highlight);
}

/* Hero Section */
.manuscrito {
  font-family: 'Great Vibes', cursive;
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 18px;
  letter-spacing: 1px;
  font-weight: 400;
  font-style: normal;
  display: inline-block;
  animation: glowText 2s infinite;
}
@keyframes glowText {
  0%, 100% {
    text-shadow: 0 0 8px var(--accent), 0 0 24px var(--highlight);
    filter: brightness(1.1);
  }
  50% {
    text-shadow: 0 0 32px var(--highlight), 0 0 48px var(--accent);
    filter: brightness(1.3);
  }
}
.hero-section {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, var(--primary) 0%, var(--card-bg) 100%);
  box-shadow: var(--shadow);
  padding: 64px 0 48px 0;
}
.hero-avatar {
  width: 180px;
  height: 180px;
  border-radius: 100%;
  box-shadow: 0 4px 32px var(--card-bg);
  object-fit: cover;
  margin-bottom: 32px;
  border: 4px solid var(--highlight);
  transition: transform 0.3s;
}
.hero-avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 40px var(--accent);
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
}
.hero-content h1 {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 18px;
  letter-spacing: 2px;
}
.hero-content p {
  font-size: 1.3rem;
  color: var(--highlight);
  margin-bottom: 32px;
}

/* Botón cambio de modo */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 32px;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  box-shadow: 0 2px 12px var(--card-bg);
  cursor: pointer;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.theme-toggle:hover {
  background: var(--primary);
  color: var(--accent);
  transform: scale(1.08);
}

/* Secciones */
section {
  max-width: 1700px;
  width: 90vw;
  margin: 48px auto;
  padding: 32px 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Galería de proyectos */
.projects-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.project-thumb {
  background: linear-gradient(135deg, var(--primary) 60%, var(--card-bg) 100%);
  border-radius: 18px;
  box-shadow: 0 6px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  border: 1.5px solid var(--card-bg);
}
.project-thumb:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow: 0 12px 36px rgba(0,0,0,0.22);
  border-color: var(--highlight);
}
.project-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  transition: filter 0.2s;
}
.project-thumb:hover img {
  filter: brightness(1.08) saturate(1.2);
}
.project-thumb-title {
  padding: 1.1rem 0.5rem 1rem 0.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--primary);
  background: linear-gradient(0deg, var(--primary) 90%, transparent 100%);
  width: 100%;
  font-size: 1.12rem;
  letter-spacing: 0.5px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb-buttons {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin: 1rem 0 0.5rem 0;
}
.btn-demo, .btn-github {
  background: linear-gradient(90deg, var(--highlight) 60%, var(--accent) 100%);
  color: var(--primary);
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.btn-demo:hover, .btn-github:hover {
  background: linear-gradient(90deg, var(--accent) 60%, var(--highlight) 100%);
  color: var(--primary);
  transform: scale(1.08);
}

/* Modal de proyecto */
.project-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(30,32,48,0.85);
  justify-content: center;
  align-items: center;
}
.project-modal.show {
  display: flex;
}
.project-modal-content {
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 90vw;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s;
}
@keyframes modalIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.project-modal-img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.close-modal {
  position: absolute;
  top: 12px; right: 18px;
  font-size: 2rem;
  color: var(--highlight);
  cursor: pointer;
}

/* Habilidades */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 2rem 0 1rem 0;
}

.skills-list li {
  background: var(--card-bg);
  color: var(--primary);
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.3s, transform 0.2s, background 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  font-size: 1rem;
  cursor: pointer;
  min-width: 70px;
  position: relative;
  height: auto;
  justify-content: center;
}

.skills-list li:hover {
  background: var(--accent);
  color: var(--bg);
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 0 16px 4px var(--highlight), 0 0 32px 8px var(--accent);
  animation: skillGlow 0.7s;
}

@keyframes skillGlow {
  0% {
    box-shadow: 0 0 0px 0px var(--highlight), 0 0 0px 0px var(--accent);
  }
  60% {
    box-shadow: 0 0 16px 4px var(--highlight), 0 0 32px 8px var(--accent);
  }
  100% {
    box-shadow: 0 2px 8px var(--shadow);
  }
}

.skills-list i {
  font-size: 1.7rem;
  margin-bottom: 0.2rem;
  transition: color 0.2s;
  color: var(--highlight);
}
.skills-list li:hover i {
  color: var(--bg);
}
.skills-list span {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 0.1rem;
}

/* Botón flotante contacto */
.contact-float-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--highlight);
  color: var(--accent);
  border: none; 
  border-radius: 80%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 24px 8px var(--highlight), 0 0 48px 16px var(--accent);
  z-index: 999;
  transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  animation: pulseGlow 1.6s infinite;
}
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 24px 8px var(--highlight), 0 0 48px 16px var(--accent);
  }
  50% {
    box-shadow: 0 0 48px 16px var(--highlight), 0 0 80px 32px var(--accent);
  }
}
.contact-float-btn:hover {
  background: var(--primary);
  color: var(--accent);
  transform: scale(1.12) rotate(-4deg);
}
/* Icono del botón flotante contacto */
.contact-float-btn i {
  color: var(--primary);
  transition: color 0.2s;
}
body.dark-mode .contact-float-btn i {
  color: var(--text);
}

/* Footer */
footer {
  background: var(--accent);
  color: var(--primary);
  text-align: center;
  padding: 18px 0;
  margin-top: 48px;
  font-size: 1rem;
  letter-spacing: 1px;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Responsive */
@media (max-width: 900px) {
  section {
    max-width: 98vw;
    padding: 24px 6vw;
  }
  .projects-gallery {
    grid-template-columns: 1fr;
  }
  nav ul {
    gap: 16px;
  }
  .stack-grid {
    flex-direction: column;
    gap: 18px;
    align-items: center;
  }
}
@media (max-width: 600px) {
  .hero-content h1 {
    font-size: 1.3rem;
  }
  .hero-avatar {
    width: 64px;
    height: 64px;
  }
  section {
    padding: 16px 2vw;
  }
}

/* Animaciones */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes modalIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.contact-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(30,32,48,0.85);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}
.contact-modal.show {
  display: flex;
}
.contact-modal-content {
  background: linear-gradient(120deg, var(--card-bg) 80%, var(--primary) 100%);
  color: var(--text);
  border-radius: var(--radius);
  padding: 2.8rem 2.2rem 2.2rem 2.2rem;
  max-width: 420px;
  width: 96vw;
  position: relative;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1.5px solid var(--primary);
  animation: modalIn 0.22s;
}
.contact-modal-content h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Contacto */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.contact-form label {
  font-weight: 600;
  color: var(--highlight);
  margin-bottom: 0.2rem;
}
.contact-form input,
.contact-form textarea {
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 2px 8px var(--shadow);
  resize: none;
  width: 100%;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--highlight);
  background: var(--primary);
}
.contact-form .btn-primary {
  background: linear-gradient(90deg, var(--highlight) 60%, var(--accent) 100%);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: background 0.18s, transform 0.18s;
  align-self: flex-end;
}
.contact-form .btn-primary:hover {
  background: linear-gradient(90deg, var(--accent) 60%, var(--highlight) 100%);
  transform: scale(1.06);
}
/* Cursor máquina de escribir para el modal de proyectos */
.typewriter-cursor {
  display: inline-block;
  width: 10px;
  height: 1.3em;
  background: var(--highlight);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink-cursor 0.7s steps(1) infinite;
  border-radius: 2px;
}
@keyframes blink-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}