/* ─── FUENTES ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Inter:opsz,wght@14..32,700;14..32,800&display=swap');

/* ─── VARIABLES ──────────────────────────────── */
:root {
  --primary-blue: #0066ff;
  --light-blue:   #00a8ff;
  --white:        #ffffff;
  --black:        #0a0a0a;
  --gray-light:   #f5f5f7;
  --text-gray:    #333333;
  --body-font:    'DM Sans', sans-serif;
  --heading-font: 'Inter', sans-serif;

  /* Dark mode vars (default = light) */
  --bg:           #ffffff;
  --bg-alt:       #f5f5f7;
  --text:         #333333;
  --text-light:   #666666;
  --card-bg:      #ffffff;
  --nav-bg:       rgba(255,255,255,0.85);
  --nav-bg-scroll:rgba(255,255,255,0.95);
  --border:       rgba(0,0,0,0.03);
  --footer-bg:    #0a0a0a;
  --footer-text:  #ffffff;
}

/* ─── DARK MODE ──────────────────────────────── */
body.dark-mode {
  --bg:           #11122e;
  --bg-alt:       #151515;
  --text:         #e8e8e8;
  --text-light:   #aaaaaa;
  --card-bg:      #1a1a1a;
  --nav-bg:       rgba(13,13,13,0.88);
  --nav-bg-scroll:rgba(13,13,13,0.97);
  --border:       rgba(255,255,255,0.06);
  --footer-bg:    #080808;
  --footer-text:  #cccccc;
  --gray-light:   #151515;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ─── LAYOUT ─────────────────────────────────── */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section { padding: 80px 0; }

/* ─── TIPOGRAFÍA ─────────────────────────────── */
h1, h2, h3 {
  font-family: var(--heading-font);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

/* Párrafos y texto de cuerpo usan DM Sans */
p, li, a, span, label, input, textarea, .section-subtitle {
  font-family: var(--body-font);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); margin-bottom: 20px; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem);   margin-bottom: 20px; }

.section-title    { text-align: center; margin-bottom: 20px; }
.section-subtitle { text-align: center; font-size: 1.15rem; color: var(--text-light); margin-bottom: 60px; }
.text-blue        { color: var(--primary-blue); }

/* Subtítulo hero */
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.75;
  max-width: 520px;
}

/* ─── BOTONES ────────────────────────────────── */
.btn-primary {
  display: block;
  width: fit-content;
  margin-bottom: 10px;
  background: var(--primary-blue);
  color: var(--white);
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(0, 102, 255, 0.2);
}

.btn-primary i { margin-left: 8px; transition: transform 0.3s ease; }

.btn-primary:hover {
  background: var(--light-blue);
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover i { transform: translateX(5px); }

/* Botón WhatsApp en sección contacto */
.btn-wsp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  padding: 13px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 1rem;
  margin: 20px 0 10px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}
.btn-wsp i { font-size: 1.3rem; }
.btn-wsp:hover {
  background: #1ebe5d;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.45);
}

/* ─── NAVBAR ─────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  z-index: 1000;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Acento de color en el navbar: línea inferior con gradiente */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-blue) 0%, var(--light-blue) 50%, #a855f7 100%);
  opacity: 0.8;
}

body.dark-mode .navbar {
  background: var(--nav-bg);
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }

.logo           { display: flex; flex-direction: column; line-height: 1.2; }
.logo-skilario  {
  font-family: var(--heading-font);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-dev       { font-size: 0.72rem; font-weight: 500; letter-spacing: 2.5px; color: var(--primary-blue); }

.nav-menu { display: flex; list-style: none; gap: 40px; }

.nav-menu a {
  font-family: var(--body-font);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 0; height: 2px;
  background: var(--primary-blue);
  transition: width 0.3s ease;
}

.nav-menu a:hover             { color: var(--primary-blue); }
.nav-menu a:hover::after      { width: 100%; }

/* Nav actions: dark toggle + hamburger */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botón modo oscuro */
.dark-toggle {
  background: var(--bg-alt);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50px;
  padding: 7px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-family: var(--body-font);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.25s ease;
  outline: none;
  white-space: nowrap;
}

.dark-toggle i { font-size: 0.85rem; }

.dark-toggle:hover {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

body.dark-mode .dark-toggle {
  background: #1e1e1e;
  border-color: #333;
  color: #fbbf24;
}

body.dark-mode .dark-toggle:hover {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #111;
}

.hamburger { display: none; flex-direction: column; cursor: pointer; }

.bar {
  width: 25px; height: 3px;
  background: var(--text);
  margin: 3px 0;
  transition: all 0.3s ease;
}

/* ─── HERO ───────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem clamp(1.25rem, 5vw, 3rem) 5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  transition: background 0.3s ease;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  width: 100%;
}

.hero-text {
  flex: 1;
  max-width: 540px;
}

.hero__visual {
  position: relative;
  z-index: 1;
  flex: 0 0 460px;
  width: 460px;
}

.hero__card {
  background: rgba(0, 102, 255, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 102, 0.3), 0 0 0 1px rgba(56, 189, 248, .15);
  animation: floatCard 5s ease-in-out infinite;
  width: 100%;
}

@keyframes floatCard {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}

.hero__card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.hero__card-title {
  margin-left: auto;
  font-size: .78rem;
  color: rgba(57, 86, 121, 0.7);
  font-family: var(--body-font);
}

.hero__card-body {
  padding: 1.6rem 1.8rem;
  font-family: 'Courier New', monospace;
  font-size: .95rem;
  line-height: 2;
  background: rgba(5, 15, 45, 0.5);
}

@media (max-width: 900px) {
  .hero { padding: 6rem 1.25rem 4rem; }
  .hero-content { flex-direction: column; align-items: flex-start; gap: 2.5rem; }
  .hero-text { max-width: 100%; }
  .hero__visual { flex: none; width: 100%; }
  .hero__card-body { font-size: .82rem; padding: 1.2rem; }
}

/* Código */
.code-line    { white-space: pre; color: white; }
.code-indent  { padding-left: 1.6rem; }
.code-keyword { color: #C792EA; }
.code-var     { color: #82AAFF; }
.code-key     { color: white; }
.code-string  { color: #C3E88D; }
.code-fn      { color: #89DDFF; }
.code-cursor  { color: var(--light-blue); animation: blink 1s infinite; }

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

.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot--red    { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green  { background: #28c840; }

@keyframes scrollDot { 0%{ transform:translateY(0); opacity:1 } 100%{ transform:translateY(10px); opacity:0 } }

/* ─── SERVICIOS ──────────────────────────────── */
.services { background: var(--bg); transition: background 0.3s ease; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.service-card {
  background: var(--card-bg);
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  text-align: center;
}

body.dark-mode .service-card {
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 102, 255, 0.12);
  border-color: var(--light-blue);
}

.card-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 25px;
}

.card-icon i { font-size: 30px; color: var(--white); }
.service-card h3 { margin-bottom: 15px; font-size: 1.4rem; }
.service-card p  { color: var(--text-light); font-size: 0.95rem; }

/* ─── DESCRIPCIÓN ────────────────────────────── */
.description { background: var(--bg-alt); transition: background 0.3s ease; }

.description-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* Imagen 20px más grande */
.description-image img {
  width: calc(100% + 20px);
  max-width: calc(100% + 20px);
  border-radius: 10px;
  box-shadow: 0 20px 30px rgba(0,0,0,0.12);
  display: block;
}

.description-text p    { margin-bottom: 15px; font-size: 1.05rem; color: var(--text); }
.description-text i    { margin-right: 10px; }
.description-text strong { color: var(--text); }

/* ─── PROYECTOS ──────────────────────────────── */
.projects { background: var(--bg); transition: background 0.3s ease; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover img { transform: scale(1.1); }

.project-overlay {
  position: absolute;
  bottom: -100%; left: 0;
  width: 100%; padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: var(--white);
  transition: bottom 0.4s ease;
}

.project-card:hover .project-overlay { bottom: 0; }
.project-overlay h4 { font-size: 1.3rem; margin-bottom: 5px; font-family: var(--heading-font); }
.project-overlay p  { font-family: var(--body-font); }

/* ─── CONTACTO ───────────────────────────────── */
.contact { background: var(--bg); transition: background 0.3s ease; }

.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.contact-info { width: 100%; }

.contact-info p  { margin: 20px 0; font-size: 1.05rem; color: var(--text); }
.contact-info i  { color: var(--primary-blue); width: 30px; font-size: 1.3rem; }

.social-icons { margin-top: 30px; }

.social-icons a {
  display: inline-block;
  width: 45px; height: 45px;
  background: var(--bg-alt);
  border-radius: 50%;
  text-align: center; line-height: 45px;
  color: var(--primary-blue);
  margin-right: 10px;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.social-icons a:hover {
  background: var(--primary-blue);
  color: var(--white);
  transform: translateY(-3px);
}

.contact-form { width: 100%; }

.contact-form input,
.contact-form textarea {
  width: 100%; padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: var(--body-font);
  font-size: 1rem;
  transition: all 0.3s ease;
  text-align: left;
  background: var(--card-bg);
  color: var(--text);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.contact-form .btn-primary { margin: 0 auto; }

@media (max-width: 768px) {
  .contact-container { padding: 0 1rem; }
}

/* ─── FOOTER ─────────────────────────────────── */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 30px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: background 0.3s ease;
}

/* ─── WHATSAPP FLOTANTE ──────────────────────── */
.whatsapp {
  position: fixed;
  bottom: 60px; right: 20px;
  z-index: 999;
  background: #25D366;
  width: 52px; height: 52px;
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; align-items: center; justify-content: center;
}

.whatsapp-icon {
  font-size: 1.6rem;
  color: #fff;
  line-height: 1;
}

.whatsapp:hover {
  transform: scale(1.15);
  box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
}

/* ─── ANIMACIONES ────────────────────────────── */
.animate-fade-in { animation: fadeIn 1s ease forwards; }
.animate-float   { animation: float 6s ease-in-out infinite; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-20px); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%; top: 70px;
    flex-direction: column;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    width: 100%; text-align: center;
    padding: 40px 0; gap: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
  }

  .nav-menu.active { left: 0; }

  .hamburger { display: flex; }

  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .hero {
    flex-direction: column;
    padding: 6rem 1.25rem 4rem;
    align-items: stretch;
  }

  .hero__visual {
    flex: none;
    margin-left: 0; padding-left: 0;
    margin-top: 2.5rem;
    width: 100%;
  }

  .hero__card-header { padding: .75rem 1rem; }
  .hero__card-body { font-size: .82rem; padding: 1.2rem; }

  .hero-content,
  .description-container,
  .contact-container { grid-template-columns: 1fr; text-align: center; }

  .hero-text    { margin: 0 auto; }
  .hero-image   { grid-row: 1; }
  .description-image { grid-row: 2; }
  .contact-info { text-align: center; }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.8rem; }
  .service-card { padding: 30px 20px; }
}

/* El modo oscuro SOLO se activa con la clase .dark-mode via botón */
