/* Formação como trajetória: um único painel contínuo, do técnico à pós-graduação. */
html body.single-page-portfolio #formacao .education-path {
  --education-line: color-mix(in srgb, var(--theme-accent) 42%, var(--theme-border));
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--theme-surface-strong) 90%, transparent);
  box-shadow: 0 22px 54px color-mix(in srgb, var(--theme-text) 7%, transparent);
}

html body.single-page-portfolio #formacao .education-path__item {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 330px;
  flex-direction: column;
  padding: 30px clamp(24px, 2.4vw, 38px) 28px;
  background: transparent;
  transition: background-color .22s ease;
}

/* Trilho explícito: começa no primeiro ponto e termina no terceiro. */
html body.single-page-portfolio #formacao .education-path__track {
  position: absolute;
  z-index: 1;
  top: 66px;
  left: calc(clamp(24px, 2.4vw, 38px) + 6px);
  right: calc(33.333% - clamp(24px, 2.4vw, 38px) - 6px);
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--theme-accent) 78%, var(--theme-border)), var(--education-line) 50%, color-mix(in srgb, var(--theme-accent) 66%, var(--theme-border)));
  pointer-events: none;
}

html body.single-page-portfolio #formacao .education-path__item::after {
  content: "";
  position: absolute;
  right: clamp(24px, 2.4vw, 38px);
  bottom: 0;
  left: clamp(24px, 2.4vw, 38px);
  height: 2px;
  background: var(--theme-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .24s ease;
}

html body.single-page-portfolio #formacao .education-path__item:hover,
html body.single-page-portfolio #formacao .education-path__item:focus-within {
  background: color-mix(in srgb, var(--theme-accent-2) 7%, transparent);
}

html body.single-page-portfolio #formacao .education-path__item:hover::after,
html body.single-page-portfolio #formacao .education-path__item:focus-within::after {
  transform: scaleX(1);
}

html body.single-page-portfolio #formacao .education-path__type {
  margin: 0;
  color: var(--theme-text-soft);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

html body.single-page-portfolio #formacao .education-path__marker {
  position: relative;
  display: flex;
  align-items: center;
  height: 35px;
}

html body.single-page-portfolio #formacao .education-path__marker > span {
  position: relative;
  z-index: 2;
  display: block;
  width: 13px;
  height: 13px;
  border: 3px solid var(--theme-surface-strong);
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 0 1px var(--education-line);
  transition: transform 90ms ease-out, box-shadow 420ms cubic-bezier(.4, 0, .2, 1);
}

html body.single-page-portfolio #formacao .education-path__item:hover .education-path__marker > span,
html body.single-page-portfolio #formacao .education-path__item:focus-within .education-path__marker > span {
  transform: scale(1.16);
  box-shadow: 0 0 0 1px var(--education-line), 0 0 0 6px color-mix(in srgb, var(--theme-accent) 12%, transparent), 0 0 18px color-mix(in srgb, var(--theme-accent) 30%, transparent);
}

html body.single-page-portfolio #formacao [data-education-stage="current"] .education-path__marker > span::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 46%, transparent);
  border-radius: inherit;
  animation: education-current 2.4s ease-out infinite;
}

html body.single-page-portfolio #formacao .education-path__item h3 {
  max-width: 350px;
  margin: 9px 0 8px;
  color: var(--theme-text);
  font-family: var(--font-ui, Manrope, sans-serif);
  font-size: clamp(19px, 1.5vw, 23px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -.035em;
}

html body.single-page-portfolio #formacao .education-path__issuer {
  margin: 0;
  color: var(--theme-text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

html body.single-page-portfolio #formacao .education-path__description,
html body.single-page-portfolio #formacao .education-path__details {
  max-width: 40ch;
  margin-top: 15px;
  color: var(--theme-text-soft);
  font-size: 14px;
  line-height: 1.62;
}

html body.single-page-portfolio #formacao .education-path__details p {
  margin: 0;
}

html body.single-page-portfolio #formacao .education-path__description p {
  margin: 0;
}

html body.single-page-portfolio #formacao .education-path__details[hidden] {
  display: none !important;
}

html body.single-page-portfolio #formacao .education-path__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding-top: 22px;
  color: var(--theme-text-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

html body.single-page-portfolio #formacao [data-education-stage="current"] .education-path__meta {
  color: var(--theme-accent);
}

html body.single-page-portfolio #formacao .education-path__action {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 42px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--theme-text);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

html body.single-page-portfolio #formacao .education-path__action > span:last-child {
  transition: transform .18s ease;
}

html body.single-page-portfolio #formacao .education-path__action:hover {
  color: var(--theme-accent);
}

html body.single-page-portfolio #formacao .education-path__action:hover > span:last-child {
  transform: translate(2px, -2px);
}

html body.single-page-portfolio #formacao .education-path__action:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 4px;
}

@keyframes education-current {
  0% { opacity: .72; transform: scale(.72); }
  70%, 100% { opacity: 0; transform: scale(1.45); }
}

@media (max-width: 820px) {
  html body.single-page-portfolio #formacao .education-path {
    grid-template-columns: minmax(0, 1fr);
  }

  html body.single-page-portfolio #formacao .education-path__item {
    min-height: 0;
    padding: 26px 24px 26px 65px;
  }

  html body.single-page-portfolio #formacao .education-path__track {
    display: none;
  }

  /* No celular, cada item liga seu ponto ao ponto seguinte. */
  html body.single-page-portfolio #formacao .education-path__item:not(:last-child)::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 36px;
    left: 35px;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 74%, var(--theme-border)), var(--education-line));
    pointer-events: none;
    transition: width 90ms ease-out, background-color 420ms cubic-bezier(.4, 0, .2, 1), box-shadow 420ms cubic-bezier(.4, 0, .2, 1);
  }

  html body.single-page-portfolio #formacao .education-path__item:not(:last-child):is(:hover, :focus-within)::before {
    width: 2px;
    height: 100%;
    background: var(--theme-accent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--theme-accent) 24%, transparent);
  }

  html body.single-page-portfolio #formacao .education-path__item + .education-path__item {
    border-top: 1px solid color-mix(in srgb, var(--theme-border) 70%, transparent);
  }

  html body.single-page-portfolio #formacao .education-path__marker {
    position: absolute;
    top: 30px;
    left: 29px;
    height: auto;
  }

  html body.single-page-portfolio #formacao .education-path__item h3 {
    margin-top: 8px;
  }

  html body.single-page-portfolio #formacao .education-path__meta {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.single-page-portfolio #formacao .education-path__item,
  html body.single-page-portfolio #formacao .education-path__item::before,
  html body.single-page-portfolio #formacao .education-path__item::after,
  html body.single-page-portfolio #formacao .education-path__action > span:last-child,
  html body.single-page-portfolio #formacao .education-path__marker > span {
    transition: none;
  }

  html body.single-page-portfolio #formacao [data-education-stage="current"] .education-path__marker > span::after {
    animation: none;
  }
}
