/* ============================================================
   OFFENSIVE SKILLS · El Camino del Hacker
   Estilos del roadmap (Scroll-Triggered Vertical Timeline)
   ============================================================ */

/* ---------- Tokens locales (prefijados para no chocar) ---------- */
.hk-roadmap {
  --hk-bg: #2b2b2b;
  --hk-bg-alt: #232323;
  --hk-card: #2e2e2e;
  --hk-card-grad-a: #414141;
  --hk-card-grad-b: #333333;
  --hk-accent: #beefbe;       /* verde pálido — identidad */
  --hk-accent-2: #98ff98;     /* verde luminoso */
  --hk-final: #1caedb;
  --hk-green-deep: #006202;
  --hk-text: #ceefce;
  --hk-text-soft: #a1aebd;
  --hk-text-mut: #888;
  --hk-white: #ffffff;
  --hk-star: #f0c040;
  --hk-line: rgba(190, 239, 190, 0.18);

  --hk-font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --hk-font-mono: "JetBrains Mono", "Fira Code", ui-monospace, "Courier New", monospace;

  box-sizing: border-box;
}
.hk-roadmap * {
  box-sizing: border-box;
}

/* HERO (merged into .hk-roadmap) */

/* Rejilla técnica de fondo */
.hk-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hk-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hk-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(120% 80% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 40%, #000 30%, transparent 80%);
  opacity: 0.5;
  animation: hk-grid-pan 24s linear infinite;
}
@keyframes hk-grid-pan {
  to { background-position: 48px 48px; }
}

/* Halo verde */
.hk-hero__glow {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 60vw;
  max-width: 640px;
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(152, 255, 152, 0.18) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.hk-hero__title {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.hk-grad {
  background: linear-gradient(120deg, var(--hk-accent) 0%, var(--hk-accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hk-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  color: var(--hk-text-soft);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hk-hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
}
.hk-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.hk-hero__stat-num {
  font-family: var(--hk-font-mono);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--hk-accent-2);
}
.hk-hero__stat-lbl {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hk-text-mut);
}

/* ============================================================
   ROADMAP
   ============================================================ */
.hk-roadmap {
  position: relative;
  background: radial-gradient(120% 120% at 50% 0%, #1f1f1f 0%, var(--hk-bg) 55%, var(--hk-bg-alt) 100%);
  color: var(--hk-text);
  padding: 3rem 1.25rem 2rem;
  font-family: var(--hk-font-sans);
  overflow: hidden;
}

.hk-roadmap__head {
  max-width: 720px;
  margin: 0 auto 4rem;
  text-align: center;
}

/* ---------- Timeline ---------- */
.hk-timeline {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* Línea central */
.hk-timeline__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--hk-line);
}
.hk-timeline__progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--hk-accent-2), var(--hk-accent));
  box-shadow: 0 0 12px rgba(152, 255, 152, 0.6);
  transition: height 0.1s linear;
}

/* ---------- Badges de etapa (centrados) ---------- */
.hk-stage {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 3.5rem 0 2.5rem;
  z-index: 3;
}
.hk-stage__badge {
  font-family: var(--hk-font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--hk-bg);
  background: linear-gradient(120deg, var(--hk-accent) 0%, var(--hk-accent-2) 100%);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--hk-bg), 0 0 24px rgba(190, 239, 190, 0.25);
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hk-stage.is-visible .hk-stage__badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hk-stage__badge--final {
  background: linear-gradient(45deg, #3bb849, #1caedb);
  color: var(--hk-white);
  font-size: 1rem;
  padding: 0.8rem 2rem;
}

/* ---------- Nodos / tarjetas ---------- */
.hk-node {
  position: relative;
  width: 50%;
  padding: 1rem 3rem;
  margin: 0.5rem 0;
  display: flex;
}
.hk-node[data-side="left"]  { left: 0; justify-content: flex-end; }
.hk-node[data-side="right"] { left: 50%; justify-content: flex-end; }

/* Punto sobre la línea */
.hk-node__dot {
  position: absolute;
  top: 2.1rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--hk-bg);
  border: 2px solid var(--hk-accent);
  z-index: 4;
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}
.hk-node[data-side="left"]  .hk-node__dot { right: -8px; }
.hk-node[data-side="right"] .hk-node__dot { left: -8px; }
.hk-node.is-visible .hk-node__dot {
  background: var(--hk-accent-2);
  box-shadow: 0 0 0 5px rgba(152, 255, 152, 0.18), 0 0 18px rgba(152, 255, 152, 0.7);
  transform: scale(1.1);
}

/* Tarjeta */
.hk-card {
  position: relative;
  display: inline-block;
  text-align: left;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(150deg, var(--hk-card-grad-a) 0%, var(--hk-card-grad-b) 100%);
  border: 1px solid rgba(190, 239, 190, 0.12);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  /* estado inicial (oculto) */
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Estado visible (.is-visible inyectada por IntersectionObserver) */
.hk-node.is-visible .hk-card {
  opacity: 1;
  transform: translateY(0);
}

.hk-card:hover {
  border-color: rgba(190, 239, 190, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 24px rgba(190, 239, 190, 0.12);
}

.hk-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

/* Miniatura del curso */
.hk-card__thumb {
  margin: calc(-1.4rem - 1px) calc(-1.5rem - 1px) 1.1rem;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--hk-card-grad-b);
}
.hk-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.06);
  filter: brightness(0.85) saturate(0.9);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}
.hk-node.is-visible .hk-card__thumb img {
  opacity: 1;
  transform: scale(1);
}
.hk-card:hover .hk-card__thumb img {
  filter: brightness(1) saturate(1);
  transform: scale(1.04);
}
/* Overlay sutil para integrar la imagen con la tarjeta */
.hk-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hk-card__tag {
  font-family: var(--hk-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hk-accent);
  border: 1px solid rgba(190, 239, 190, 0.4);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
}
.hk-card__tag--hot   { color: var(--hk-accent-2); border-color: rgba(152, 255, 152, 0.5); }
.hk-card__tag--extra { color: var(--hk-star); border-color: rgba(240, 192, 64, 0.45); }

.hk-card__rate {
  font-family: var(--hk-font-mono);
  font-size: 0.82rem;
  color: var(--hk-white);
  white-space: nowrap;
}
.hk-card__rate em { color: var(--hk-text-mut); font-style: normal; }
.hk-card__rate--none { color: var(--hk-text-mut); font-size: 0.74rem; }
.hk-star { color: var(--hk-star); }

.hk-card__title {
  font-size: 1.18rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--hk-white);
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.hk-card__desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--hk-text-soft);
  margin: 0 0 1.2rem;
}

.hk-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 1px solid rgba(190, 239, 190, 0.1);
  padding-top: 0.9rem;
}
.hk-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--hk-font-mono);
  font-size: 0.8rem;
  color: var(--hk-text);
}
.hk-ic {
  font-style: normal;
  color: var(--hk-accent);
  font-size: 0.9rem;
}

/* Botón "Explorar el curso" */
.hk-card__btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1.2rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--hk-font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, #43bb43, #078207);
  border: 1px solid rgba(152, 255, 152, 0.35);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 6px 18px rgba(7, 130, 7, 0.3);
}

.hk-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(7, 130, 7, 0.4), 0 0 20px rgba(152, 255, 152, 0.25);
}

.hk-card__btn:active {
  transform: translateY(0) scale(0.97);
}

.hk-card__btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(110deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.35) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.hk-card__btn:hover::before {
  left: 130%;
}

/* Stagger sutil según el lado */
.hk-node[data-side="right"] .hk-card { transition-delay: 0.08s; }

/* ── Nodo final ───────────────────────────────────────────── */
.hk-node--final {
  width: 100%;
  left: 0 !important;
  justify-content: center !important;
  padding: 0;
  margin: 0.5rem 0 3rem;
}
.hk-node__dot--final {
  position: absolute;
  top: 0;
  left: 49%;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--hk-final);
  border: 2px solid #1cdbbe;
  z-index: 4;
  transform: translateX(-50%) rotate(45deg);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.hk-node--final.is-visible .hk-node__dot--final {
  background: var(--hk-final);
  box-shadow: 0 0 0 5px rgba(152, 255, 152, 0.18), 0 0 18px rgba(152, 255, 152, 0.7);
  transform: rotate(45deg);
}
.hk-card--final {
  max-width: 500px;
  text-align: center;
  margin-top: 2.5rem;
  padding: 2rem 2rem 1.8rem;
  border-color: rgba(190, 239, 190, 0.25);
  background: linear-gradient(150deg, #383838 0%, #2a2a2a 100%);
}
.fa-flag-checkered {
  color: #1cdbbe;
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}
.hk-card--final .hk-card__title {
  font-size: 1.3rem;
}
.hk-card--final .hk-card__desc {
  font-size: 0.95rem;
  max-width: 380px;
  margin: 0 auto 1.5rem;
}
.hk-card__final-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
  filter: grayscale(0.2);
}
.hk-card__btn--telegram {
  background: linear-gradient(120deg, #1e96c8, #0088cc);
  border-color: rgba(0, 136, 204, 0.4);
  box-shadow: 0 6px 18px rgba(0, 136, 204, 0.3);
  max-width: 320px;
  margin: 0 auto;
}
.hk-card__btn--telegram:hover {
  box-shadow: 0 10px 26px rgba(0, 136, 204, 0.4), 0 0 20px rgba(0, 136, 204, 0.25);
}

/* ============================================================
   RESPONSIVE — colapsa a una sola columna
   ============================================================ */
@media (max-width: 760px) {
  .hk-timeline__line { left: 20px; transform: none; }

  .hk-node {
    width: 100%;
    left: 0 !important;
    padding: 0.6rem 0 0.6rem 3.25rem;
    justify-content: flex-start !important;
  }
  .hk-node .hk-card { max-width: 100%; }
  .hk-node__dot {
    left: 13px !important;
    right: auto !important;
  }

  .hk-stage { justify-content: flex-start; padding-left: 0; }

  .hk-node--final {
    padding: 0 0.6rem 0 3.25rem;
    text-align: left;
  }
  .hk-node--final .hk-card {
    text-align: left;
  }
  .hk-node--final .hk-card__desc {
    margin: 0 0 1.2rem;
  }
  .hk-card__btn--telegram {
    margin: 0;
  }
  .hk-node__dot--final {
    left: 13px !important;
    top: 0;
    transform: rotate(45deg);
  }
}

body:has(.hk-roadmap) .footer-container {
  margin-top: 0;
}

/* Accesibilidad: respeta reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .hk-card,
  .hk-stage__badge {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hk-hero__grid { animation: none; }
}

