/* Ruta de Aprendizaje: skill tree de series. */
.site-main--learning-path {
  --learning-math: #d7aa55;
  --learning-math-rgb: 215, 170, 85;
  --learning-ai: #78b98c;
  --learning-ai-rgb: 120, 185, 140;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 4vw, 3rem) 4rem;
  color: #fdf0d5;
  /* Keep the shared non-home background visible, as on the Series page. */
  background: transparent;
}

.learning-path-header {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.learning-path-header__eyebrow {
  margin: 0 0 0.6rem;
  color: var(--learning-math);
  font-family: "Montserrat", var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.learning-path-header__title {
  margin: 0;
  color: #fdf0d5;
  font-family: "Montserrat", var(--font-body);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.08;
  text-transform: uppercase;
}

.learning-path-header__description {
  max-width: 58ch;
  margin: 1rem auto 0;
  color: rgba(253, 240, 213, 0.7);
  font-family: var(--font-hero);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}

.learning-path-header__description p {
  margin: 0;
}

.learning-path-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1.2rem;
  max-width: 1120px;
  margin: 1.5rem auto 0;
  font-family: "Montserrat", var(--font-body);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.learning-path-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(253, 240, 213, 0.74);
}

.learning-path-legend__item::before {
  width: 0.58rem;
  height: 0.58rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.learning-path-legend__item--mathematics {
  color: var(--learning-math);
}

.learning-path-legend__item--artificial-intelligence {
  color: var(--learning-ai);
}

.learning-path-tree {
  position: relative;
  width: min(100%, 1200px);
  height: 500px;
  margin: 0.75rem auto 0;
  isolation: isolate;
}

.learning-path-connections {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.learning-path-connections path {
  fill: none;
  stroke: url(#learning-path-line);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.72;
  animation: learning-path-draw 1.15s ease-out both;
}

.learning-path-connections path:nth-of-type(2) { animation-delay: 80ms; }
.learning-path-connections path:nth-of-type(3) { animation-delay: 160ms; }
.learning-path-connections path:nth-of-type(4) { animation-delay: 240ms; }
.learning-path-connections path:nth-of-type(5) { animation-delay: 320ms; }

.learning-path-node {
  --field-color: var(--learning-math);
  --field-rgb: var(--learning-math-rgb);
  --node-size: clamp(118px, 11.5vw, 142px);
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 50%;
  width: min(22%, 190px);
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  animation: learning-path-node-in 620ms cubic-bezier(0.2, 0.75, 0.28, 1) forwards;
}

.learning-path-node--linear-algebra { left: 10%; animation-delay: 80ms; }
.learning-path-node--statistics { left: 30%; animation-delay: 150ms; }
.learning-path-node--probability { left: 50%; animation-delay: 220ms; }
.learning-path-node--calculus { left: 70%; animation-delay: 290ms; }
.learning-path-node--analysis { top: 285px; left: 70%; animation-delay: 420ms; }

.learning-path-node--machine-learning {
  --field-color: var(--learning-ai);
  --field-rgb: var(--learning-ai-rgb);
  --node-size: clamp(138px, 14vw, 165px);
  top: 285px;
  left: 30%;
  width: min(28%, 220px);
  animation-delay: 490ms;
}

.learning-path-node__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

a.learning-path-node__link:focus-visible {
  border-radius: 0.5rem;
  outline: 2px solid var(--field-color);
  outline-offset: 8px;
}

.learning-path-node__circle {
  position: relative;
  display: grid;
  width: var(--node-size);
  height: var(--node-size);
  padding: 6px;
  place-items: center;
  border: 3px solid var(--field-color);
  border-radius: 50%;
  background: rgba(2, 8, 12, 0.92);
  box-shadow:
    0 0 0 1px rgba(var(--field-rgb), 0.16),
    0 0 28px rgba(var(--field-rgb), 0.13),
    inset 0 0 20px rgba(var(--field-rgb), 0.08);
  transition: box-shadow 260ms ease, transform 260ms ease;
}

.learning-path-node__circle::after {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(var(--field-rgb), 0.32);
  border-radius: inherit;
  content: "";
  transition: inset 260ms ease, opacity 260ms ease;
}

a.learning-path-node__link:hover .learning-path-node__circle,
a.learning-path-node__link:focus-visible .learning-path-node__circle {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(var(--field-rgb), 0.3),
    0 0 42px rgba(var(--field-rgb), 0.24),
    inset 0 0 24px rgba(var(--field-rgb), 0.12);
}

a.learning-path-node__link:hover .learning-path-node__circle::after,
a.learning-path-node__link:focus-visible .learning-path-node__circle::after {
  inset: -13px;
  opacity: 0.7;
}

.learning-path-node__media.series-card__media {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #000;
}

.learning-path-node__media.series-card__media::after {
  display: none;
}

.learning-path-node__media.has-serie-anim {
  background: #000;
}

.learning-path-node__media .series-card-anim__canvas,
.learning-path-node__media .series-card__img {
  border-radius: 50%;
}

.learning-path-node__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.85rem;
}

.learning-path-node__field {
  color: var(--field-color);
  font-family: "Montserrat", var(--font-body);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.learning-path-node__name {
  margin-top: 0.35rem;
  color: #fdf0d5;
  font-family: "Montserrat", var(--font-body);
  font-size: clamp(0.74rem, 1.15vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.25;
  text-transform: uppercase;
}

.learning-path-node.is-unavailable {
  filter: grayscale(0.55);
  opacity: 0.58;
}

@keyframes learning-path-node-in {
  from { opacity: 0; transform: translate(-50%, 18px) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes learning-path-draw {
  from { stroke-dasharray: 1 1200; stroke-dashoffset: 1; opacity: 0; }
  to { stroke-dasharray: 1200 1; stroke-dashoffset: 0; opacity: 0.72; }
}

@media (max-width: 760px) {
  .site-main--learning-path {
    padding-inline: 0.75rem;
  }

  .learning-path-header,
  .learning-path-legend {
    padding-inline: 0.5rem;
  }

  .learning-path-tree {
    height: 610px;
    margin-top: 1rem;
  }

  .learning-path-node {
    --node-size: clamp(100px, 28vw, 122px);
    top: 10px;
    width: 46%;
  }

  .learning-path-node--linear-algebra {
    left: 25%;
  }

  .learning-path-node--statistics {
    left: 75%;
  }

  .learning-path-node--probability {
    top: 195px;
    left: 25%;
  }

  .learning-path-node--calculus {
    top: 195px;
    left: 75%;
  }

  .learning-path-node--analysis {
    top: 400px;
    left: 70%;
  }

  .learning-path-node--machine-learning {
    --node-size: clamp(126px, 35vw, 148px);
    top: 400px;
    left: 30%;
    width: 46%;
  }
}

@media (max-width: 390px) {
  .learning-path-node__field {
    font-size: 0.52rem;
    letter-spacing: 0.09em;
  }

  .learning-path-node__name {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .learning-path-connections path,
  .learning-path-node {
    animation: none;
    opacity: 1;
  }

  .learning-path-node__circle,
  .learning-path-node__circle::after {
    transition: none;
  }
}
