/* VARIABLES GLOBALES */
:root {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #18223a;
  --border: #1e293b;
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-blue: #2563eb;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --success: #22c55e;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* RESET GENERAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* CABECERA (HEADER & NAVEGACIÓN) */
.header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-cta {
  background: var(--accent-blue);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-cta:hover {
  background: #1d4ed8;
  box-shadow: 0 0 15px var(--accent-glow);
}

/* BOTÓN HAMBURGUESA MÓVIL */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1002;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* HERO SECTION */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.15), transparent 50%);
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50px;
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

/* HERO PROFILE CARD */
.hero-card-profile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.avatar {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  object-position: center top;
  background: #1e293b;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.profile-role {
  font-size: 0.9rem;
  color: var(--accent);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* SECCIONES COMUNES */
.section {
  padding: 80px 0;
}

.section-dark {
  background-color: #080c14;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 50px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* GRID DE SERVICIOS */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
}

.service-card.popular {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, var(--bg-card) 100%);
}

.tag-popular {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--accent);
  color: #0b0f19;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.service-card .desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.service-features {
  list-style: none;
  margin-bottom: 28px;
}

.service-features li {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-features li span {
  color: var(--accent);
  font-weight: 700;
}

.btn-card {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #ffffff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-card:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* GRID DE PROYECTOS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.browser-frame {
  background: #0f172a;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.browser-dots {
  display: flex;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.browser-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.project-img-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  background: #000000;
  cursor: zoom-in;
  overflow: hidden;
}

.project-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}

.project-img-wrapper:hover img {
  transform: scale(1.04);
}

.project-img-wrapper::after {
  content: '🔍 Ampliar';
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(11, 15, 25, 0.85);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.project-card:hover .project-img-wrapper::after {
  opacity: 1;
}

.project-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.project-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.project-result {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--success);
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #e2e8f0;
  margin-bottom: 16px;
}

.btn-project {
  display: block;
  text-align: center;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-project:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

/* SOBRE MÍ */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.about-text h2 {
  font-size: 2.2rem;
  margin: 12px 0 16px;
  line-height: 1.2;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.skill-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.about-quote-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  position: relative;
}

.quote-icon {
  font-size: 4rem;
  color: var(--accent);
  line-height: 1;
  opacity: 0.3;
}

.quote-text {
  font-size: 1.15rem;
  font-style: italic;
  margin: 10px 0 16px;
  color: #f1f5f9;
}

.quote-author {
  font-weight: 700;
  color: var(--accent);
}

/* FORMULARIO (CAMPOS CLAROS Y VISIBLES) */
.form-wrapper {
  max-width: 650px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
}

/* REGLA CRÍTICA: Texto e inputs con alto contraste */
.form-control {
  width: 100%;
  padding: 12px 14px;
  background-color: #0f172a !important;
  border: 1px solid #334155 !important;
  border-radius: 8px;
  color: #ffffff !important;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control::placeholder {
  color: #64748b !important;
}

.form-control:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

select.form-control option {
  background-color: #0f172a;
  color: #ffffff;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* FOOTER */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  background: #070a10;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

/* LIGHTBOX MODAL */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(5, 8, 14, 0.94);
  backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
}

.lightbox-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.lightbox-caption {
  margin-top: 14px;
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #ffffff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--accent);
}

/* RESPONSIVE MÓVIL (< 850px) */
@media (max-width: 850px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: #0b0f19;
    border-left: 1px solid var(--border);
    padding: 80px 24px 30px;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    z-index: 1001;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  }

  .nav.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
  }

  .nav-link {
    font-size: 1.1rem;
    color: #ffffff;
    display: block;
    width: 100%;
  }

  .nav-cta {
    width: 100%;
    text-align: center;
    margin-top: 15px;
  }

  .hero-container,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* EFECTO TYPEWRITER */
.typewriter-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.typewriter-cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 300;
  margin-left: 2px;
  animation: blinkCursor 0.8s infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}