/* Variables CSS */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-dark: #111827;
  --border-color: #e5e7eb;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --max-width: 1200px;
}

/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navegación */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.nav-brand a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 0.25rem;
}

.nav-toggle span {
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
  padding: 2rem 0;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.9),
    rgba(139, 92, 246, 0.8)
  );
  z-index: 1;
}

.hero-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: slideUp 1s ease forwards 0.2s;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  opacity: 0;
  animation: slideUp 1s ease forwards 0.4s;
  max-width: 500px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: slideUp 1s ease forwards 0.5s;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #a7f3d0;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: slideUp 1s ease forwards 0.6s;
}

.hero-social {
  opacity: 0;
  animation: slideUp 1s ease forwards 0.7s;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-image {
  position: relative;
  width: 400px;
  height: 400px;
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
}

.floating-element {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
}

.floating-element:nth-child(3) {
  bottom: 30%;
  left: 5%;
  animation-delay: 2s;
}

.floating-element:nth-child(4) {
  bottom: 10%;
  right: 10%;
  animation-delay: 3s;
}

.tech-icon {
  font-size: 1.5rem;
}

.code-preview {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--border-radius);
  padding: 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 300px;
  margin: 2rem auto;
}

.code-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-dots {
  display: flex;
  gap: 0.5rem;
}

.code-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.code-dots span:nth-child(1) {
  background: #ff5f56;
}
.code-dots span:nth-child(2) {
  background: #ffbd2e;
}
.code-dots span:nth-child(3) {
  background: #27ca3f;
}

.code-content {
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
  line-height: 1.4;
}

.code-line {
  margin-bottom: 0.25rem;
  opacity: 0;
  animation: typewriter 0.5s ease forwards;
}

.code-line:nth-child(1) {
  animation-delay: 1s;
}
.code-line:nth-child(2) {
  animation-delay: 1.2s;
}
.code-line:nth-child(3) {
  animation-delay: 1.4s;
}
.code-line:nth-child(4) {
  animation-delay: 1.6s;
}
.code-line:nth-child(5) {
  animation-delay: 1.8s;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-indicator span {
  display: block;
  width: 2px;
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  animation: scroll 2s ease-in-out infinite;
}

/* Secciones generales */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* About Section */
.about {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.about-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.about-intro {
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.about-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.highlight h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.highlight p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.skills-section h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.skill-item {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid transparent;
}

.skill-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.experience-years {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.years-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.years-number {
  font-size: 2rem;
  font-weight: 700;
}

.years-text {
  font-size: 0.65rem;
}

/* Services Section */
.services {
  padding: 6rem 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-top: 4px solid var(--primary-color);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.service-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.service-features {
  list-style: none;
}

.service-features li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1rem;
}

.service-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

/* Portfolio Section */
.portfolio {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(320px, 1fr)
  ); /* Reducido el mínimo */
  gap: 2rem;
  margin-bottom: 3rem;
}

.project-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  width: 100%;
  height: 200px; /* Reducido de 280px a 200px para más rectangular */
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* Mostrar la parte superior de la imagen */
  transition: var(--transition);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: var(--transition);
  padding: 1.5rem 2rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-overlay .btn {
  margin: 0;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-link {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 15px;
  transition: var(--transition);
}

.project-link:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
}

.project-link.github {
  background: #333;
}

.project-link.demo {
  background: var(--accent-color);
}

.project-link.demo:hover {
  background: #0891b2;
}

.portfolio-cta {
  text-align: center;
}

/* Experience Section */
.experience {
  padding: 6rem 0;
}

.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid white;
  box-shadow: 0 0 0 4px var(--border-color);
}

.timeline-content {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 45%;
  margin: 0 2rem;
}

.timeline-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-date {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Contact Section */
.contact {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.contact-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.contact-details {
  margin: 2rem 0;
}

.contact-details div {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-availability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.availability-indicator {
  width: 12px;
  height: 12px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  justify-content: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: #5048e5;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
  border-color: white;
}

.btn-block {
  width: 100%;
}

.btn-arrow {
  transition: var(--transition);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Footer */
.footer {
  padding: 4rem 0 2rem;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0f172a 100%);
  color: white;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand p {
  color: #d1d5db;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.footer-contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #d1d5db;
  font-size: 0.95rem;
}

.footer-contact-item a {
  color: #d1d5db;
  text-decoration: none;
  transition: var(--transition);
}

.footer-contact-item a:hover {
  color: var(--primary-color);
}

.footer-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.footer-links-section h4,
.footer-services-section h4,
.footer-social-section h4 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.footer-links,
.footer-services {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a,
.footer-services a {
  color: #d1d5db;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.95rem;
}

.footer-links a:hover,
.footer-services a:hover {
  color: var(--primary-color);
  padding-left: 0.5rem;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.footer-social .social-link {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.footer-social .social-link:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-color);
  transform: translateX(0.25rem);
}

.footer-cta {
  text-align: center;
}

.footer-cta p {
  color: #d1d5db;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.footer-btn {
  display: inline-block;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.footer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-bottom-links {
  display: flex;
  gap: 2rem;
}

.footer-bottom-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--primary-color);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-modal {
  background: white;
  border-radius: var(--border-radius);
  max-width: 1000px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  z-index: 10;
}

.modal-header {
  position: relative;
  height: 400px; /* Reducido de 600px para más rectangular */
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.modal-content-body {
  padding: 2rem;
}

.modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.modal-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.modal-tech-tag {
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--primary-color);
  font-weight: 600;
  text-align: center;
}

.modal-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.modal-link {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-link:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

.modal-link.github {
  background: #333;
}

.modal-link.demo {
  background: var(--accent-color);
}

.image-gallery-modal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.gallery-image:hover {
  border-color: var(--primary-color);
  transform: scale(1.02);
}

/* Animaciones */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes typewriter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scroll {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* RESPONSIVE DESIGN - MÓVILES */
@media (max-width: 768px) {
  /* Navegación móvil */
  .nav-menu {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    flex-direction: column;
    padding: 2rem 0;
    gap: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    top: 100%;
  }

  .nav-link {
    padding: 1rem 2rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 1.1rem;
    color: var(--text-primary);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-link::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  /* Contenedores y espaciado */
  .container {
    padding: 0 1rem;
  }

  .hero-container,
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }

  /* Hero section */
  .hero {
    padding: 8rem 0 4rem;
    min-height: auto;
    text-align: center;
  }

  .hero-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: none;
  }

  .hero-stats {
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .hero-social {
    margin-top: 1rem;
  }

  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }

  /* Floating elements en hero */
  .floating-elements {
    display: none;
  }

  .code-preview {
    width: 280px;
    margin: 1rem auto;
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* Secciones */
  .about,
  .services,
  .portfolio,
  .experience,
  .contact {
    padding: 4rem 0;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .section-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
  }

  /* Cards y elementos */
  .service-card,
  .about-card,
  .contact-card,
  .contact-form {
    margin: 0 0.5rem;
    padding: 1.5rem;
  }

  /* About section */
  .about-highlights {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }

  .portfolio-filters {
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  /* Skills grid */
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .skill-item {
    padding: 1rem;
    font-size: 0.875rem;
  }

  /* Timeline */
  .timeline::before {
    left: 2rem;
  }

  .timeline-item {
    flex-direction: row !important;
    margin-left: 3rem;
  }

  .timeline-dot {
    left: 2rem;
  }

  .timeline-content {
    width: 100%;
    margin: 0;
    padding: 1.5rem;
  }

  /* Formulario */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  /* Footer */
  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    padding: 0 1rem;
  }

  .footer-contact-info {
    align-items: center;
  }

  .footer-social {
    align-items: center;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-bottom-links {
    gap: 1rem;
  }

  /* Modal responsive */
  .project-modal {
    width: 95%;
    margin: 1rem;
    max-height: 85vh;
  }

  .modal-content-body {
    padding: 1.5rem;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-header {
    height: 250px;
  }

  .modal-links {
    flex-direction: column;
  }

  .modal-link {
    text-align: center;
    justify-content: center;
  }

  /* Social links */
  .social-link {
    font-size: 0.8rem;
    padding: 0.5rem 0.875rem;
  }

  .project-image {
    height: 180px; /* Aún más rectangular en móvil */
  }
}

/* Responsive para pantallas muy pequeñas */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .project-card {
    margin: 0;
  }

  .footer-brand h3 {
    font-size: 1.5rem;
  }

  .footer-bottom-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .project-image {
    height: 160px; /* Máximo rectangular para pantallas pequeñas */
  }
}

/* AGREGAR AL FINAL DEL main.css - Fix específico para iPhone 12 y pantallas similares */

/* iPhone 12 y pantallas entre 390px - 430px */
@media (max-width: 430px) {
  .hero-actions {
    padding: 0 1rem;
    margin-bottom: 2rem;
  }

  .hero-actions .btn {
    width: 100%;
    margin: 0;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 48px; /* Para mejor touch target */
  }

  .hero-container {
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 2rem;
    padding: 0 0.5rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    padding: 0 0.5rem;
  }

  .hero-stats {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .hero-social {
    padding: 0 1rem;
  }

  /* Asegurar que todos los botones tengan márgenes apropiados */
  .btn {
    margin: 0.25rem 0;
  }

  /* Portfolio filters */
  .portfolio-filters {
    padding: 0 1.5rem;
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-width: auto;
  }

  /* Section headers */
  .section-header {
    padding: 0 1rem;
  }

  .section-title {
    font-size: 1.8rem;
    padding: 0 0.5rem;
  }

  .section-subtitle {
    padding: 0 1rem;
    font-size: 0.95rem;
  }

  /* Cards con márgenes más seguros */
  .service-card,
  .project-card,
  .about-card,
  .contact-card,
  .contact-form {
    margin: 0 1rem;
  }

  /* Portfolio grid */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Form buttons */
  .contact-form .btn-block {
    margin: 0;
    width: 100%;
  }

  /* Social links en hero */
  .social-link {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    margin: 0.25rem;
  }
}

/* iPhone 12 Mini y pantallas muy pequeñas - 375px y menos */
@media (max-width: 375px) {
  .hero-actions {
    padding: 0 1.25rem;
  }

  .hero-actions .btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.2;
  }

  .section-title {
    font-size: 1.65rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Asegurar márgenes mínimos en todos los elementos */
  .service-card,
  .project-card,
  .about-card,
  .contact-card,
  .contact-form {
    margin: 0 1.25rem;
  }

  .portfolio-grid {
    padding: 0 1.25rem;
  }

  .portfolio-filters {
    padding: 0 1.75rem;
  }
}
