@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap");

/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --bg-main: #d9e3e8;
  --text-dark: #27292f;
  --primary: #356f78;
  --primary-dark: #214f57;
  --accent: #6ec3d6;
  --accent-light: #b7f0b6;
  --card-dark: #04111d;
  --btn-dark: #1d1b2a;
  --white-soft: #e8f1f5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Nunito", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #111;
  padding: 20px;
  /* agrega esto: */
  overflow-x: hidden;
}

/* ============================================================
   1. HEADER & NAVBAR
   ============================================================ */
.header {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
  transition: 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 6px rgba(112, 199, 218, 0.6));
}

.navbar {
  display: flex;
  align-items: center;
  gap: 30px;
}

.navbar a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  transition: 0.3s ease;
}

.navbar a:hover {
  color: var(--primary-dark);
}

.active-link {
  color: #1d3f46 !important;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 4px;
}

/* ============================================================
   2. SWITCH DE IDIOMA (va junto al header/navbar)
   ============================================================ */
.lang-switch-pro {
  width: 140px;
  cursor: pointer;
}

.switch-track {
  position: relative;
  background: #1b1b2b;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

.led {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00ff6a;
  box-shadow:
    0 0 6px #00ff6a,
    0 0 12px #00ff6a,
    0 0 18px rgba(0, 255, 106, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 4;
  transition: all 0.3s ease;
  animation: ledGlow 1.5s infinite;
}

.lang-switch-pro.en .led {
  left: calc(100% - 22px);
  background: #ffc107;
  box-shadow:
    0 0 6px #ffc107,
    0 0 12px #ffc107,
    0 0 18px rgba(255, 193, 7, 0.7);
}

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

.switch-thumb {
  position: absolute;
  width: 55%;
  height: 75%;
  background: linear-gradient(145deg, #b6f0b2, #8cd98a);
  border-radius: 6px;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.35s cubic-bezier(0.68, -0.3, 0.27, 1.3);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.4);
}

.lang-switch-pro.en .switch-thumb {
  left: calc(100% - 55% - 6px);
  background: linear-gradient(145deg, #ffd36e, #e3a93b);
}

.label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  z-index: 2;
  font-size: 14px;
  color: #aaa;
  transition: 0.3s;
}

.lang-switch-pro:not(.en) .es {
  color: #1b1b2b;
}
.lang-switch-pro.en .en {
  color: #1b1b2b;
}

.lang-switch-pro:active .switch-thumb {
  transform: translateY(-50%) scale(0.95);
}

/* ============================================================
  TOAST NAVBAR BOTON VOLVER ARRIBA
   ============================================================ */
.nav-toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #07101c;
  border: 1.5px solid #2a7080;
  border-radius: 30px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6ec3d6;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  white-space: nowrap;
}

.nav-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-toast:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.nav-toast i {
  font-size: 0.85rem;
}

/* ============================================================
   3. HERO
   ============================================================ */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-main);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  padding: 20px 32px 60px;
  align-items: end;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: calc(45% - 85px);
  bottom: 60px;
  background: #2f5e66;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 2;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.image-card {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.image-card img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

.hero-content h1 {
  font-size: 3.6rem;
  color: var(--text-dark);
  font-weight: 800;
  margin-bottom: 10px;
}

.hero-content h2 {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 520px;
}

.hero-content h2 span {
  background: rgba(53, 111, 120, 0.9);
  color: #e8f7fb;
  padding: 0 6px;
  border-radius: 4px;
}

.social-title {
  font-size: 2rem;
  font-weight: 900;
  color: #1e1b25;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

.social-links {
  display: flex;
  gap: 14px;
  margin: 28px 0 26px;
}

.social-links a {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #2f3135;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  background: var(--primary-dark);
}

.line {
  width: 70%;
  height: 5px;
  background: var(--accent);
  margin-bottom: 40px;
}

.areas-card {
  background: linear-gradient(135deg, #03101c, #2f5e66);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  max-width: 520px;
  min-height: 180px;
}

.arrow-circle {
  min-width: 58px;
  height: 58px;
  border: 4px solid #b9ffc5;
  border-radius: 50%;
  color: #b9ffc5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.areas-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.area-btn {
  border: none;
  padding: 14px 24px;
  border-radius: 40px;
  background: #cfdee4;
  color: var(--primary);
  text-align: left;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s ease;
}

.area-btn:hover {
  background: #ffffff;
  transform: translateX(-5px);
}

.active-area {
  background: #ffffff;
  color: #183a41;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

/* ============================================================
   4. ABOUT — SECCIÓN SOBRE MÍ
   ============================================================ */
.about {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-main);
  padding: 50px 32px 70px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: center;
}

/* --- Tarjeta router (columna izquierda) --- */
.router-card-wrap {
  background: #07101c;
  border: 1.5px solid #1c3a4a;
  border-radius: 16px;
  padding: 14px 14px 18px;
  position: relative;
  box-shadow:
    0 0 0 1px #0a1e2c,
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.router-card-wrap::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: linear-gradient(90deg, #1c3a4a, #2a7080, #1c3a4a);
  border-radius: 2px;
}

/* LEDs */
.rc-led-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 4px 12px;
}

.rc-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rc-led.green {
  background: #22c55e;
  animation: ledBlink 1.4s ease-in-out infinite;
}
.rc-led.cyan {
  background: #06b6d4;
  animation: ledBlink 1.4s ease-in-out infinite 0.4s;
}
.rc-led.amber {
  background: #f59e0b;
  animation: ledBlink 2.2s ease-in-out infinite 0.8s;
}
.rc-led.off {
  background: #1c3a4a;
}

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

.rc-led-labels {
  font-size: 9px;
  color: #2a7080;
  letter-spacing: 1px;
  font-family: "Courier New", monospace;
  margin-left: 4px;
}

/* Marco foto */
.rc-photo-frame {
  background: #040d14;
  border: 1px solid #1c3a4a;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rc-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.rc-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(110, 195, 214, 0.45),
    transparent
  );
  animation: scanMove 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes scanMove {
  0% {
    top: 0%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Parte inferior tarjeta */
.rc-bottom {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rc-cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0a1e2c;
  border: 1px solid #2a7080;
  border-radius: 8px;
  padding: 9px 14px;
  color: #8fe8b8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  transition:
    background 0.25s,
    border-color 0.25s,
    transform 0.2s;
}

.rc-cv-btn:hover {
  background: #122535;
  border-color: #6ec3d6;
  transform: translateY(-2px);
}

.rc-cv-icon {
  width: 26px;
  height: 26px;
  border: 1.5px solid #8fe8b8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.rc-port-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  background: #040d14;
  border: 1px solid #162c3a;
  border-radius: 6px;
}

.rc-port {
  height: 8px;
  border-radius: 3px;
  flex: 1;
}
.rc-port.teal {
  background: #1c6a78;
}
.rc-port.cyan-p {
  background: #1285a0;
}
.rc-port.amber-p {
  flex: 0 0 18px;
  background: #b57320;
}
.rc-port.dark-p {
  flex: 0 0 16px;
  background: #0a1e2c;
  border: 1px solid #1c3a4a;
  border-radius: 50%;
}
.rc-port.orange-p {
  flex: 0 0 16px;
  background: #a83c18;
  border-radius: 50%;
}

/* --- Texto columna derecha --- */
.rc-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #07101c;
  border: 1px solid #2a7080;
  border-radius: 20px;
  padding: 6px 16px 6px 10px;
  color: #6ec3d6;
  font-size: 0.82rem;
  font-family: "Courier New", monospace;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}

.rc-section-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: tagLed 1.4s ease-in-out infinite;
}

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

.about-text h2 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 6px;
  line-height: 1.1;
}

.about-text .underline {
  width: 52px;
  height: 4px;
  background: #22c55e;
  border-radius: 2px;
  margin-bottom: 18px;
}

.about-text h3 {
  font-family: "Nunito", sans-serif;
  font-size: 0.88rem;
  color: #2a7080;
  letter-spacing: 1px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-text h3::before {
  content: "";
  width: 20px;
  height: 1px;
  background: #2a7080;
  flex-shrink: 0;
}

.about-text p {
  font-size: 1rem;
  color: #3a4a52;
  line-height: 1.75;
  margin: 0 0 28px;
  border-left: 3px solid #1c3a4a;
  padding-left: 16px;
  max-width: 480px;
}

.rc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}

.rc-stat-block {
  background: #07101c;
  border: 1px solid #1c3a4a;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rc-stat-label {
  font-size: 0.72rem;
  color: #2a7080;
  letter-spacing: 1px;
  font-family: "Courier New", monospace;
  font-weight: 600;
}

.rc-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: #6ec3d6;
}

/* ============================================================
   5. PROYECTOS
   ============================================================ */
.projects {
  background: var(--bg-main);
  padding: 60px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.projects h2 {
  position: relative;
  display: inline-block;
  padding: 12px 28px;
  margin-bottom: 40px;
  background: #04111d;
  color: var(--accent-light);
  border: 2px solid #8fe18f;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 2.9rem;
  box-shadow:
    0 0 10px rgba(143, 225, 143, 0.4),
    inset 0 0 8px rgba(143, 225, 143, 0.2);
}

.projects h2::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff6a;
  box-shadow:
    0 0 6px #00ff6a,
    0 0 12px #00ff6a;
  animation: blinkLED 1.2s infinite;
}

.projects h2::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e3a93b;
  box-shadow:
    0 0 6px #e3a93b,
    0 0 12px #e3a93b;
}

@keyframes blinkLED {
  0%,
  100% {
    opacity: 1;
    box-shadow:
      0 0 6px #00ff6a,
      0 0 12px #00ff6a;
  }
  50% {
    opacity: 0.3;
    box-shadow:
      0 0 2px #00ff6a,
      0 0 5px #00ff6a;
  }
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.project-card {
  background: var(--card-dark);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 30px rgba(110, 195, 214, 0.25);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 16px;
  flex: 1;
}

.project-info h3 {
  margin: 0;
  color: var(--accent-light);
  font-size: 1.2rem;
  font-weight: 800;
}

.project-info p {
  font-size: 0.95rem;
  color: #ccc;
  margin-top: 8px;
  line-height: 1.4;
}

/* ============================================================
   CERTIFICADOS
   ============================================================ */

.certs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 32px 70px;
  position: relative;
  background: #0a1628;
}

.certs::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(42, 112, 128, 0.06) 39px,
      rgba(42, 112, 128, 0.06) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(42, 112, 128, 0.06) 39px,
      rgba(42, 112, 128, 0.06) 40px
    );
  pointer-events: none;
}
/* Header */
.certs-header {
  margin-bottom: 40px;
}

.certs-title-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: #04111d;
  border: 2px solid #1c6a78;
  border-radius: 10px;
  box-shadow:
    0 0 20px rgba(34, 197, 94, 0.15),
    inset 0 0 8px rgba(28, 106, 120, 0.2);
}

.certs-title-box h2 {
  color: #b7f0b6;
  font-size: 2.9rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
}

/* LED izquierdo parpadeante */
.certs-title-box::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff6a;
  box-shadow:
    0 0 6px #00ff6a,
    0 0 12px #00ff6a;
  animation: certBlinkLED 1.2s infinite;
}

/* LED derecho fijo */
.certs-title-box::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e3a93b;
  box-shadow:
    0 0 6px #e3a93b,
    0 0 12px #e3a93b;
}

@keyframes certBlinkLED {
  0%,
  100% {
    opacity: 1;
    box-shadow:
      0 0 6px #00ff6a,
      0 0 12px #00ff6a;
  }
  50% {
    opacity: 0.2;
    box-shadow:
      0 0 2px #00ff6a,
      0 0 4px #00ff6a;
  }
}

/* Grid de tarjetas */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

/* Tarjeta dispositivo */
.cert-device {
  background: #07101c;
  border: 1.5px solid #1c3a4a;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 1px #0a1e2c,
    0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s;
}

.cert-device:hover {
  transform: translateY(-5px);
  border-color: #2a7080;
  box-shadow:
    0 0 0 1px #2a7080,
    0 16px 40px rgba(110, 195, 214, 0.2);
}

/* Franja superior */
.cert-device-top {
  background: #040d14;
  border-bottom: 1px solid #1c3a4a;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cd-brand {
  font-size: 9px;
  color: #2a7080;
  letter-spacing: 2px;
  font-family: "Courier New", monospace;
  flex: 1;
}

.cd-leds {
  display: flex;
  gap: 5px;
}

.cd-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.cd-led.cdg {
  background: #22c55e;
  animation: cdLed 1.4s ease-in-out infinite;
}
.cd-led.cdc {
  background: #06b6d4;
  animation: cdLed 1.4s ease-in-out infinite 0.3s;
}
.cd-led.cdo {
  background: #f59e0b;
  animation: cdLed 2s ease-in-out infinite 0.7s;
}

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

/* Marco de imagen */
.cert-img-frame {
  position: relative;
  margin: 12px;
  border: 1px solid #1c3a4a;
  border-radius: 8px;
  overflow: hidden;
  background: #040d14;
}

.cert-img-frame img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.cert-device:hover .cert-img-frame img {
  transform: scale(1.03);
}

/* Línea de escaneo */
.cert-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(110, 195, 214, 0.5),
    transparent
  );
  animation: certScan 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes certScan {
  0% {
    top: 0%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Overlay hover */
.cert-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 17, 29, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}

.cert-device:hover .cert-overlay {
  opacity: 1;
}

.cert-overlay-btn {
  background: #07101c;
  border: 1.5px solid #22c55e;
  border-radius: 30px;
  padding: 10px 22px;
  color: #22c55e;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

/* Parte inferior */
.cert-device-bottom {
  padding: 4px 14px 14px;
}

.cert-ports {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  padding: 6px 8px;
  background: #040d14;
  border: 1px solid #162c3a;
  border-radius: 5px;
}

.cp {
  height: 6px;
  border-radius: 2px;
  flex: 1;
}
.cp.ct {
  background: #1c6a78;
}
.cp.cc {
  background: #1285a0;
}
.cp.ca {
  flex: 0 0 14px;
  background: #b57320;
}
.cp.cd {
  flex: 0 0 12px;
  background: #0a1e2c;
  border: 1px solid #1c3a4a;
  border-radius: 50%;
}

.cert-name {
  color: #b7f0b6;
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.cert-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cert-badge {
  font-size: 9px;
  color: #2a7080;
  letter-spacing: 1px;
  font-family: "Courier New", monospace;
  background: #040d14;
  border: 1px solid #1c3a4a;
  border-radius: 4px;
  padding: 2px 8px;
}

/* ============================================================
   MODAL CERTIFICADO
   ============================================================ */
.cert-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 17, 29, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.cert-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.cert-modal-inner {
  background: #07101c;
  border: 1.5px solid #2a7080;
  border-radius: 14px;
  overflow: hidden;
  max-width: 860px;
  width: 100%;
  transform: scale(0.88);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 60px rgba(42, 112, 128, 0.3);
}

.cert-modal.open .cert-modal-inner {
  transform: scale(1);
}

.cert-modal-top {
  background: #040d14;
  border-bottom: 1px solid #1c3a4a;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cert-modal-top span {
  font-size: 10px;
  color: #2a7080;
  letter-spacing: 2px;
  font-family: "Courier New", monospace;
}

.cert-modal-close {
  width: 28px;
  height: 28px;
  background: #0a1e2c;
  border: 1px solid #1c3a4a;
  border-radius: 50%;
  color: #6ec3d6;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.cert-modal-close:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.cert-modal img {
  width: 100%;
  display: block;
  max-height: 80vh;
  object-fit: contain;
}

/* ============================================================
   RESPONSIVE CERTIFICADOS
   ============================================================ */
@media (max-width: 992px) {
  .certs {
    padding: 50px 24px 60px;
  }
  .certs-title-box h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .certs {
    padding: 40px 20px 50px;
  }
  .certs-title-box h2 {
    font-size: 1.6rem;
  }
  .certs-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cert-img-frame img {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .certs {
    padding: 30px 16px 40px;
  }
  .certs-title-box h2 {
    font-size: 1.4rem;
  }
  .cert-img-frame img {
    height: 150px;
  }
  .cert-name {
    font-size: 0.9rem;
  }
}
/* ============================================================
   6. SKILLS — HABILIDADES TÉCNICAS
   ============================================================ */
.skills {
  background: var(--primary);
  padding: 52px 0 72px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  /* ← SIN width: 100% */
}

.skills::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(
    circle,
    rgba(184, 242, 179, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.skills-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}
/* ============================================================
   7. HABILIDADES BLANDAS
   ============================================================ */
.soft-skills {
  background: #1a3032;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 52px 0 72px;
  box-sizing: border-box;
  /* ← SIN width: 100% */
}

/* Wrapper interno */
.skills-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.skills h2,
.soft-skills h2 {
  color: #e8f3f5;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
}

.skills-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.skill-tag {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: #b8f2b3;
  padding: 9px 20px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.92rem;
  border: 1px solid rgba(184, 242, 179, 0.3);
  transition: all 0.25s ease;
  cursor: default;
}

.skill-tag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(184, 242, 179, 0.1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.skill-tag:hover {
  border-color: rgba(184, 242, 179, 0.8);
  transform: translateY(-2px);
}

.skill-tag:hover::before {
  transform: scaleX(1);
}

/* ============================================================
   8. FOOTER
   ============================================================ */
.footer {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  color: white;
}

.footer-bg {
  background: url("images/footer.png") no-repeat center;
  background-size: cover;
  width: 100%;
  height: 220px;
}

.footer-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer-logo img {
  width: 120px;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.footer-logo img:hover {
  transform: scale(1.1) translateY(-3px);
  filter: drop-shadow(0 0 12px #b7f0b6);
}

.footer-social {
  position: absolute;
  right: 120px;
  top: 95px;
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: white;
  font-size: 22px;
  transition: 0.3s ease;
}

.footer-social a:hover {
  transform: scale(1.2);
  color: var(--accent-light);
  text-shadow: 0 0 10px var(--accent-light);
}

.footer-copy {
  font-size: 14px;
  width: 70%;
  text-align: right;
}

/* ============================================================
   9. BOTÓN VOLVER ARRIBA
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: #07101c;
  border: 1.5px solid #2a7080;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    border-color 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: #22c55e;
}
.back-to-top:hover .btt-arrow {
  border-bottom-color: #22c55e;
}

.btt-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 9px solid #6ec3d6;
  margin-bottom: 2px;
  transition: border-bottom-color 0.2s;
}

.btt-led {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: bttLed 1.6s ease-in-out infinite;
}

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

/* ============================================================
   10. ANIMACIONES GLOBALES
   ============================================================ */
.typing::after {
  content: "|";
  margin-left: 4px;
  animation: cursor 1s infinite;
}

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

/* ============================================================
   11. RESPONSIVE — TABLET (max 992px)
   ============================================================ */
@media (max-width: 992px) {
  .header {
    padding: 16px 24px;
  }

  /* Hero */
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 24px 50px;
  }
  .hero::before {
    display: none;
  }
  .hero-content h1 {
    font-size: 2.8rem;
  }
  .hero-content h2 {
    font-size: 1.6rem;
  }
  .hero-image {
    order: -1;
  }
  .image-card {
    max-width: 380px;
    margin: 0 auto;
  }
  .image-card img {
    max-width: 380px;
  }
  .area-btn {
    font-size: 1.2rem;
  }

  /* About */
  .about {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 24px 60px;
  }
  .router-card-wrap {
    max-width: 320px;
    margin: 0 auto;
  }
  .about-text h2 {
    font-size: 2.2rem;
  }
  .about-text p {
    font-size: 1rem;
    max-width: 100%;
  }

  /* Proyectos */
  .projects-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects h2 {
    font-size: 2.2rem;
  }

  /* Skills */
  .skills,
  .soft-skills {
    padding: 40px 0 60px;
  }
  .skills-inner {
    padding: 0 24px;
  }
  .skills h2,
  .soft-skills h2 {
    font-size: 2.2rem;
  }
}

/* ============================================================
   12. RESPONSIVE — MÓVIL GRANDE (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  /* Header apilado */
  .header {
    flex-direction: column;
    gap: 14px;
    text-align: center;
    padding: 16px 20px;
  }
  .navbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .navbar a {
    font-size: 1rem;
  }

  /* Hero */
  .hero {
    padding: 24px 20px 40px;
    gap: 24px;
  }
  .hero-content h1 {
    font-size: 2.2rem;
  }
  .hero-content h2 {
    font-size: 1.25rem;
  }
  .social-title {
    font-size: 1.5rem;
  }
  .line {
    width: 100%;
  }
  .areas-card {
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
    padding: 16px;
  }
  .area-btn {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    padding: 12px 20px;
  }
  .image-card {
    max-width: 280px;
  }
  .image-card img {
    max-width: 280px;
  }

  /* About */
  .about {
    padding: 30px 20px 50px;
  }
  .router-card-wrap {
    max-width: 100%;
  }
  .rc-stats {
    grid-template-columns: 1fr;
  }
  .about-text h2 {
    font-size: 2rem;
  }

  /* Proyectos */
  .projects {
    padding: 40px 20px;
  }
  .projects h2 {
    font-size: 1.6rem;
    padding: 10px 24px;
    word-break: break-word;
  }
  .projects-container {
    grid-template-columns: 1fr;
  }

  /* Skills */
  .skills,
  .soft-skills {
    padding: 36px 0 52px;
  }
  .skills-inner {
    padding: 0 20px;
  }
  .skills h2,
  .soft-skills h2 {
    font-size: 2rem;
  }

  /* Footer responsive */
  .footer-bg {
    height: auto;
    min-height: 180px;
  }
  .footer-content {
    position: static;
    padding: 24px 20px;
    align-items: center;
  }
  .footer-social {
    position: static;
    justify-content: center;
    margin-top: 12px;
  }
  .footer-copy {
    width: 100%;
    text-align: center;
    font-size: 12px;
  }

  /* Botón volver arriba más pequeño en móvil */
  .back-to-top {
    width: 42px;
    height: 42px;
    bottom: 20px;
    right: 20px;
  }
}

/* ============================================================
   13. RESPONSIVE — MÓVIL PEQUEÑO (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  body {
    padding: 6px;
  }

  .header {
    padding: 14px 16px;
  }
  .logo img {
    height: 34px;
  }
  .navbar {
    gap: 8px;
  }
  .navbar a {
    font-size: 0.88rem;
  }
  /* Switch de idioma más pequeño */
  .lang-switch-pro {
    width: 110px;
  }

  /* Hero */
  .hero {
    padding: 20px 16px 36px;
    gap: 20px;
  }
  .hero-content h1 {
    font-size: 1.9rem;
  }
  .hero-content h2 {
    font-size: 1.1rem;
  }
  .social-title {
    font-size: 1.3rem;
  }
  .social-links a {
    width: 40px;
    height: 40px;
  }
  .image-card {
    max-width: 240px;
  }
  .image-card img {
    max-width: 240px;
  }
  .area-btn {
    font-size: 1rem;
    padding: 10px 16px;
  }

  /* About */
  .about {
    padding: 24px 16px 40px;
  }
  .about-text h2 {
    font-size: 1.75rem;
  }
  .about-text p {
    font-size: 0.95rem;
  }
  .rc-cv-btn {
    font-size: 0.85rem;
  }
  .rc-stat-value {
    font-size: 0.9rem;
  }

  /* Proyectos */
  .projects {
    padding: 32px 16px;
  }
  .projects h2 {
    font-size: 1.4rem;
    padding: 10px 20px;
  }
  .project-card img {
    height: 160px;
  }

  /* Skills */
  .skills,
  .soft-skills {
    padding: 30px 0 44px;
  }
  .skills-inner {
    padding: 0 16px;
  }
  .skills h2,
  .soft-skills h2 {
    font-size: 1.75rem;
  }
  .skill-tag {
    font-size: 0.83rem;
    padding: 7px 15px;
  }
}
/* ============================================================
   14. RESPONSIVE — MÓVIL MUY PEQUEÑO (max 360px)
   ============================================================ */
@media (max-width: 360px) {
  .hero-content h1 {
    font-size: 1.6rem;
  }
  .hero-content h2 {
    font-size: 1rem;
  }
  .navbar a {
    font-size: 0.8rem;
  }
  .lang-switch-pro {
    width: 95px;
  }
  .projects h2 {
    font-size: 1.2rem;
    padding: 8px 18px;
  }
  .skills h2,
  .soft-skills h2 {
    font-size: 1.5rem;
  }
  .about-text h2 {
    font-size: 1.5rem;
  }
  .rc-section-tag {
    font-size: 0.72rem;
  }
}
